13#ifndef LLVM_ANALYSIS_LOADS_H
14#define LLVM_ANALYSIS_LOADS_H
31template <
typename T>
class SmallVectorImpl;
32class TargetLibraryInfo;
38 const Instruction *CtxI =
nullptr,
39 AssumptionCache *AC =
nullptr,
40 const DominatorTree *DT =
nullptr,
41 const TargetLibraryInfo *TLI =
nullptr);
48 Align Alignment,
const DataLayout &
DL,
49 const Instruction *CtxI =
nullptr,
50 AssumptionCache *AC =
nullptr,
51 const DominatorTree *DT =
nullptr,
52 const TargetLibraryInfo *TLI =
nullptr);
59 const APInt &
Size,
const DataLayout &
DL,
60 const Instruction *CtxI =
nullptr,
61 AssumptionCache *AC =
nullptr,
62 const DominatorTree *DT =
nullptr,
63 const TargetLibraryInfo *TLI =
nullptr);
74 const DataLayout &
DL, Instruction *ScanFrom,
75 AssumptionCache *AC =
nullptr,
76 const DominatorTree *DT =
nullptr,
77 const TargetLibraryInfo *TLI =
nullptr);
87 LoadInst *LI, Loop *L, ScalarEvolution &SE, DominatorTree &DT,
88 AssumptionCache *AC =
nullptr,
89 SmallVectorImpl<const SCEVPredicate *> *Predicates =
nullptr);
94 Loop *L, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC,
95 SmallVectorImpl<const SCEVPredicate *> *Predicates =
nullptr);
106 const DataLayout &
DL, Instruction *ScanFrom,
107 AssumptionCache *AC =
nullptr,
108 const DominatorTree *DT =
nullptr,
109 const TargetLibraryInfo *TLI =
nullptr);
149 BatchAAResults *AA =
nullptr,
150 bool *IsLoadCSE =
nullptr,
151 unsigned *NumScanedInst =
nullptr);
185 bool AtLeastAtomic, BasicBlock *ScanBB,
187 unsigned MaxInstsToScan, BatchAAResults *AA,
188 bool *IsLoadCSE,
unsigned *NumScanedInst);
198 const DataLayout &
DL);
200 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 isDereferenceableReadOnlyLoop(Loop *L, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC, SmallVectorImpl< const SCEVPredicate * > *Predicates=nullptr)
Return true if the loop L cannot fault on any iteration and only contains read-only memory accesses.
bool canReplacePointersInUseIfEqual(const Use &U, const Value *To, const DataLayout &DL)
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.
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.
bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L, ScalarEvolution &SE, DominatorTree &DT, AssumptionCache *AC=nullptr, SmallVectorImpl< const SCEVPredicate * > *Predicates=nullptr)
Return true if we can prove that the given load (which is assumed to be within the specified loop) wo...