13 #ifndef LLVM_ANALYSIS_LOADS_H 14 #define LLVM_ANALYSIS_LOADS_H 28 class ScalarEvolution;
35 const Instruction *CtxI =
nullptr,
36 const DominatorTree *DT =
nullptr);
45 const Instruction *CtxI =
nullptr,
46 const DominatorTree *DT =
nullptr);
53 const APInt &
Size,
const DataLayout &
DL,
54 const Instruction *CtxI =
nullptr,
55 const DominatorTree *DT =
nullptr);
67 Instruction *ScanFrom =
nullptr,
68 const DominatorTree *DT =
nullptr);
91 Instruction *ScanFrom =
nullptr,
92 const DominatorTree *DT =
nullptr);
126 AAResults *AA =
nullptr,
127 bool *IsLoadCSE =
nullptr,
128 unsigned *NumScanedInst =
nullptr);
156 unsigned MaxInstsToScan, AAResults *AA,
157 bool *IsLoadCSE,
unsigned *NumScanedInst);
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...
This class represents lattice values for constants.
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.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
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(Value *Ptr, 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 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...
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
bool isSafeToLoadUnconditionally(Value *V, Align 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.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL