LLVM 19.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::consthoist::ConstantCandidate Struct Reference

Keeps track of a constant candidate and its uses. More...

#include "llvm/Transforms/Scalar/ConstantHoisting.h"

Public Member Functions

 ConstantCandidate (ConstantInt *ConstInt, ConstantExpr *ConstExpr=nullptr)
 
void addUser (Instruction *Inst, unsigned Idx, unsigned Cost)
 Add the user to the use list and update the cost.
 

Public Attributes

ConstantUseListType Uses
 
ConstantIntConstInt
 
ConstantExprConstExpr
 
unsigned CumulativeCost = 0
 

Detailed Description

Keeps track of a constant candidate and its uses.

Definition at line 80 of file ConstantHoisting.h.

Constructor & Destructor Documentation

◆ ConstantCandidate()

llvm::consthoist::ConstantCandidate::ConstantCandidate ( ConstantInt ConstInt,
ConstantExpr ConstExpr = nullptr 
)
inline

Definition at line 89 of file ConstantHoisting.h.

Member Function Documentation

◆ addUser()

void llvm::consthoist::ConstantCandidate::addUser ( Instruction Inst,
unsigned  Idx,
unsigned  Cost 
)
inline

Add the user to the use list and update the cost.

Definition at line 93 of file ConstantHoisting.h.

References CumulativeCost, Idx, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and Uses.

Member Data Documentation

◆ ConstExpr

ConstantExpr* llvm::consthoist::ConstantCandidate::ConstExpr

Definition at line 86 of file ConstantHoisting.h.

◆ ConstInt

ConstantInt* llvm::consthoist::ConstantCandidate::ConstInt

Definition at line 85 of file ConstantHoisting.h.

◆ CumulativeCost

unsigned llvm::consthoist::ConstantCandidate::CumulativeCost = 0

Definition at line 87 of file ConstantHoisting.h.

Referenced by addUser().

◆ Uses

ConstantUseListType llvm::consthoist::ConstantCandidate::Uses

Definition at line 81 of file ConstantHoisting.h.

Referenced by addUser().


The documentation for this struct was generated from the following file: