14 #ifndef LLVM_TRANSFORMS_UTILS_EVALUATOR_H
15 #define LLVM_TRANSFORMS_UTILS_EVALUATOR_H
31 class TargetLibraryInfo;
41 ValueStack.emplace_back();
45 for (
auto &Tmp : AllocaTmps)
49 if (!Tmp->use_empty())
65 if (
Constant *CV = dyn_cast<Constant>(V))
return CV;
66 Constant *R = ValueStack.back().lookup(V);
67 assert(R &&
"Reference to an uncomputed value!");
72 ValueStack.back()[V] =
C;
89 std::deque<DenseMap<Value*, Constant*>> ValueStack;
A parsed version of the target data layout string in and methods for querying it. ...
bool EvaluateBlock(BasicBlock::iterator CurInst, BasicBlock *&NextBB)
Evaluate all instructions in block BB, returning true if successful, false if we can't evaluate it...
const SmallPtrSetImpl< GlobalVariable * > & getInvariants() const
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
const DenseMap< Constant *, Constant * > & getMutatedMemory() const
LLVM Basic Block Representation.
This is an important base class in LLVM.
void setVal(Value *V, Constant *C)
This class evaluates LLVM IR, producing the Constant representing each SSA instruction.
Iterator for intrusive lists based on ilist_node.
bool EvaluateFunction(Function *F, Constant *&RetVal, const SmallVectorImpl< Constant * > &ActualArgs)
Evaluate a call to function F, returning true if successful, false if we can't evaluate it...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
Constant * getVal(Value *V)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Evaluator(const DataLayout &DL, const TargetLibraryInfo *TLI)