ΒΆllvm::Value* FindAvailablePtrLoadStore(
llvm::Value* Ptr,
llvm::Type* AccessTy,
bool AtLeastAtomic,
llvm::BasicBlock* ScanBB,
BasicBlock::iterator& ScanFrom,
unsigned int MaxInstsToScan,
llvm::AliasAnalysis* AA,
bool* IsLoad,
unsigned int* NumScanedInst)
llvm::Value* FindAvailablePtrLoadStore(
llvm::Value* Ptr,
llvm::Type* AccessTy,
bool AtLeastAtomic,
llvm::BasicBlock* ScanBB,
BasicBlock::iterator& ScanFrom,
unsigned int MaxInstsToScan,
llvm::AliasAnalysis* AA,
bool* IsLoad,
unsigned int* NumScanedInst)
Description
Scan backwards to see if we have the value of the given pointer available locally within a small number of instructions. You can use this function to scan across multiple blocks: after you call this function, if ScanFrom points at the beginning of the block, it's safe to continue scanning the predecessors.
Declared at: llvm/include/llvm/Analysis/Loads.h:150
Parameters
- llvm::Value* Ptr
- The pointer we want the load and store to originate from.
- llvm::Type* AccessTy
- The access type of the pointer.
- bool AtLeastAtomic
- Are we looking for at-least an atomic load/store ? In case it is false, we can return an atomic or non-atomic load or store. In case it is true, we need to return an atomic load or store.
- llvm::BasicBlock* ScanBB
- The basic block to scan.
- BasicBlock::iterator& ScanFrom
- The location to start scanning from. When this function returns, it points at the last instruction scanned.
- unsigned int MaxInstsToScan
- The maximum number of instructions to scan. If this is zero, the whole block will be scanned.
- llvm::AliasAnalysis* AA
- Optional pointer to alias analysis, to make the scan more precise.
- bool* IsLoad
- Whether the returned value is a load from the same location in memory, as opposed to the value operand of a store.
- unsigned int* NumScanedInst
Returns
The found value, or nullptr if no value is found.