13#ifndef LLVM_ANALYSIS_LOADS_H
14#define LLVM_ANALYSIS_LOADS_H
30class TargetLibraryInfo;
36 const Instruction *CtxI =
nullptr,
37 AssumptionCache *AC =
nullptr,
38 const DominatorTree *DT =
nullptr,
39 const TargetLibraryInfo *TLI =
nullptr);
46 Align Alignment,
const DataLayout &
DL,
47 const Instruction *CtxI =
nullptr,
48 AssumptionCache *AC =
nullptr,
49 const DominatorTree *DT =
nullptr,
50 const TargetLibraryInfo *TLI =
nullptr);
57 const APInt &
Size,
const DataLayout &
DL,
58 const Instruction *CtxI =
nullptr,
59 AssumptionCache *AC =
nullptr,
60 const DominatorTree *DT =
nullptr,
61 const TargetLibraryInfo *TLI =
nullptr);
73 Instruction *ScanFrom =
nullptr,
74 AssumptionCache *AC =
nullptr,
75 const DominatorTree *DT =
nullptr,
76 const TargetLibraryInfo *TLI =
nullptr);
86 ScalarEvolution &SE, DominatorTree &DT,
87 AssumptionCache *AC =
nullptr);
99 Instruction *ScanFrom =
nullptr,
100 AssumptionCache *AC =
nullptr,
101 const DominatorTree *DT =
nullptr,
102 const TargetLibraryInfo *TLI =
nullptr);
136 AAResults *AA =
nullptr,
137 bool *IsLoadCSE =
nullptr,
138 unsigned *NumScanedInst =
nullptr);
171 bool AtLeastAtomic, BasicBlock *ScanBB,
173 unsigned MaxInstsToScan, AAResults *AA,
174 bool *IsLoadCSE,
unsigned *NumScanedInst);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
InstListType::iterator iterator
Instruction iterators...
This is an optimization pass for GlobalISel generic memory operations.
bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty, Align Alignment, const DataLayout &DL, const Instruction *CtxI=nullptr, AssumptionCache *AC=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.
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 ...
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...
bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L, ScalarEvolution &SE, DominatorTree &DT, AssumptionCache *AC=nullptr)
Return true if we can prove that the given load (which is assumed to be within the specified loop) wo...
cl::opt< unsigned > DefMaxInstsToScan
The default number of maximum instructions to scan in the block, used by FindAvailableLoadedValue().
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...
bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL, const Instruction *CtxI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Return true if this is always a dereferenceable pointer.
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size, const DataLayout &DL, Instruction *ScanFrom=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Return true if we know that executing a load from this value cannot trap.