Go to the documentation of this file.
13 #ifndef LLVM_ANALYSIS_LOADS_H
14 #define LLVM_ANALYSIS_LOADS_H
28 class ScalarEvolution;
29 class TargetLibraryInfo;
36 const Instruction *CtxI =
nullptr,
37 const DominatorTree *DT =
nullptr,
38 const TargetLibraryInfo *TLI =
nullptr);
45 Align Alignment,
const DataLayout &
DL,
46 const Instruction *CtxI =
nullptr,
47 const DominatorTree *DT =
nullptr,
48 const TargetLibraryInfo *TLI =
nullptr);
55 const APInt &
Size,
const DataLayout &
DL,
56 const Instruction *CtxI =
nullptr,
57 const DominatorTree *DT =
nullptr,
58 const TargetLibraryInfo *TLI =
nullptr);
70 Instruction *ScanFrom =
nullptr,
71 const DominatorTree *DT =
nullptr,
72 const TargetLibraryInfo *TLI =
nullptr);
95 Instruction *ScanFrom =
nullptr,
96 const DominatorTree *DT =
nullptr,
97 const TargetLibraryInfo *TLI =
nullptr);
131 AAResults *
AA =
nullptr,
132 bool *IsLoadCSE =
nullptr,
133 unsigned *NumScanedInst =
nullptr);
168 unsigned MaxInstsToScan, AAResults *
AA,
169 bool *IsLoadCSE,
unsigned *NumScanedInst);
This is an optimization pass for GlobalISel generic memory operations.
InstListType::iterator iterator
Instruction iterators...
bool canReplacePointersIfEqual(Value *A, Value *B, const DataLayout &DL, Instruction *CtxI)
Returns true if a pointer value A can be replace with another pointer value \B if they are deemed equ...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Return true if this is always a dereferenceable pointer.
Value * findAvailablePtrLoadStore(const MemoryLocation &Loc, Type *AccessTy, bool AtLeastAtomic, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan, AAResults *AA, bool *IsLoadCSE, unsigned *NumScanedInst)
Scan backwards to see if we have the value of the given pointer available locally within a small numb...
@ BasicBlock
Various leaf nodes.
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...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Value * FindAvailableLoadedValue(LoadInst *Load, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan=DefMaxInstsToScan, AAResults *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 ...
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size, const DataLayout &DL, Instruction *ScanFrom=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=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, Align Alignment, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Returns true if V is always a dereferenceable pointer with alignment greater or equal than requested.