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);
72 const DataLayout &
DL, Instruction *ScanFrom,
73 AssumptionCache *AC =
nullptr,
74 const DominatorTree *DT =
nullptr,
75 const TargetLibraryInfo *TLI =
nullptr);
85 ScalarEvolution &SE, DominatorTree &DT,
86 AssumptionCache *AC =
nullptr);
91 DominatorTree *DT, AssumptionCache *AC);
102 const DataLayout &
DL, Instruction *ScanFrom,
103 AssumptionCache *AC =
nullptr,
104 const DominatorTree *DT =
nullptr,
105 const TargetLibraryInfo *TLI =
nullptr);
145 BatchAAResults *AA =
nullptr,
146 bool *IsLoadCSE =
nullptr,
147 unsigned *NumScanedInst =
nullptr);
181 bool AtLeastAtomic, BasicBlock *ScanBB,
183 unsigned MaxInstsToScan, BatchAAResults *AA,
184 bool *IsLoadCSE,
unsigned *NumScanedInst);
194 const DataLayout &
DL);
196 const DataLayout &
DL);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
BlockVerifier::State From
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 * findAvailablePtrLoadStore(const MemoryLocation &Loc, Type *AccessTy, bool AtLeastAtomic, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan, BatchAAResults *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 mustSuppressSpeculation(const LoadInst &LI)
Return true if speculation of the given load must be suppressed to avoid ordering or interfering with...
Value * FindAvailableLoadedValue(LoadInst *Load, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan=DefMaxInstsToScan, BatchAAResults *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 canReplacePointersInUseIfEqual(const Use &U, const Value *To, const DataLayout &DL)
bool isDereferenceableReadOnlyLoop(Loop *L, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC)
Return true if the loop L cannot fault on any iteration and only contains read-only memory accesses.
bool canReplacePointersIfEqual(const Value *From, const Value *To, const DataLayout &DL)
Returns true if a pointer value From can be replaced with another pointer value \To if they are deeme...
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size, const DataLayout &DL, Instruction *ScanFrom, 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.
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 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.