13 #ifndef LLVM_ANALYSIS_LOADS_H 14 #define LLVM_ANALYSIS_LOADS_H 25 class ScalarEvolution;
32 const Instruction *CtxI =
nullptr,
33 const DominatorTree *DT =
nullptr);
42 const Instruction *CtxI =
nullptr,
43 const DominatorTree *DT =
nullptr);
50 const APInt &
Size,
const DataLayout &DL,
51 const Instruction *CtxI =
nullptr,
52 const DominatorTree *DT =
nullptr);
64 Instruction *ScanFrom =
nullptr,
65 const DominatorTree *DT =
nullptr);
88 Instruction *ScanFrom =
nullptr,
89 const DominatorTree *DT =
nullptr);
122 unsigned MaxInstsToScan = DefMaxInstsToScan,
124 bool *IsLoadCSE =
nullptr,
125 unsigned *NumScanedInst =
nullptr);
154 bool *IsLoad,
unsigned *NumScanedInst);
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This class represents lattice values for constants.
bool isSafeToLoadUnconditionally(Value *V, MaybeAlign Alignment, APInt &Size, const DataLayout &DL, Instruction *ScanFrom=nullptr, const DominatorTree *DT=nullptr)
Return true if we know that executing a load from this value cannot trap.
cl::opt< unsigned > DefMaxInstsToScan
The default number of maximum instructions to scan in the block, used by FindAvailableLoadedValue().
bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty, MaybeAlign Alignment, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr)
Returns true if V is always a dereferenceable pointer with alignment greater or equal than requested...
Value * FindAvailablePtrLoadStore(Value *Ptr, Type *AccessTy, bool AtLeastAtomic, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan, AliasAnalysis *AA, bool *IsLoad, unsigned *NumScanedInst)
Scan backwards to see if we have the value of the given pointer available locally within a small numb...
Value * FindAvailableLoadedValue(LoadInst *Load, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan=DefMaxInstsToScan, AliasAnalysis *AA=nullptr, bool *IsLoadCSE=nullptr, unsigned *NumScanedInst=nullptr)
Scan backwards to see if we have the value of the given load available locally within a small number ...
AAResults AliasAnalysis
Temporary typedef for legacy code that uses a generic AliasAnalysis pointer or reference.
bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr)
Return true if this is always a dereferenceable pointer.
InstListType::iterator iterator
Instruction iterators...
bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L, ScalarEvolution &SE, DominatorTree &DT)
Return true if we can prove that the given load (which is assumed to be within the specified loop) wo...