#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumeBundleQueries.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
usingnamespacellvm;
static bool isAligned(const Value *Base, const APInt &Offset, Align Alignment,
const DataLayout &DL) { … }
static bool isDereferenceableAndAlignedPointer(
const Value *V, Align Alignment, const APInt &Size, const DataLayout &DL,
const Instruction *CtxI, AssumptionCache *AC, const DominatorTree *DT,
const TargetLibraryInfo *TLI, SmallPtrSetImpl<const Value *> &Visited,
unsigned MaxDepth) { … }
bool llvm::isDereferenceableAndAlignedPointer(
const Value *V, Align Alignment, const APInt &Size, const DataLayout &DL,
const Instruction *CtxI, AssumptionCache *AC, const DominatorTree *DT,
const TargetLibraryInfo *TLI) { … }
bool llvm::isDereferenceableAndAlignedPointer(
const Value *V, Type *Ty, Align Alignment, const DataLayout &DL,
const Instruction *CtxI, AssumptionCache *AC, const DominatorTree *DT,
const TargetLibraryInfo *TLI) { … }
bool llvm::isDereferenceablePointer(const Value *V, Type *Ty,
const DataLayout &DL,
const Instruction *CtxI,
AssumptionCache *AC,
const DominatorTree *DT,
const TargetLibraryInfo *TLI) { … }
static bool AreEquivalentAddressValues(const Value *A, const Value *B) { … }
bool llvm::isDereferenceableAndAlignedInLoop(
LoadInst *LI, Loop *L, ScalarEvolution &SE, DominatorTree &DT,
AssumptionCache *AC, SmallVectorImpl<const SCEVPredicate *> *Predicates) { … }
static bool suppressSpeculativeLoadForSanitizers(const Instruction &CtxI) { … }
bool llvm::mustSuppressSpeculation(const LoadInst &LI) { … }
bool llvm::isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size,
const DataLayout &DL,
Instruction *ScanFrom,
AssumptionCache *AC,
const DominatorTree *DT,
const TargetLibraryInfo *TLI) { … }
bool llvm::isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
const DataLayout &DL,
Instruction *ScanFrom,
AssumptionCache *AC,
const DominatorTree *DT,
const TargetLibraryInfo *TLI) { … }
cl::opt<unsigned>
llvm::DefMaxInstsToScan("available-load-scan-limit", cl::init(6), cl::Hidden,
cl::desc("Use this to specify the default maximum number of instructions "
"to scan backward from a given instruction, when searching for "
"available loaded value"));
Value *llvm::FindAvailableLoadedValue(LoadInst *Load, BasicBlock *ScanBB,
BasicBlock::iterator &ScanFrom,
unsigned MaxInstsToScan,
BatchAAResults *AA, bool *IsLoad,
unsigned *NumScanedInst) { … }
static bool areNonOverlapSameBaseLoadAndStore(const Value *LoadPtr,
Type *LoadTy,
const Value *StorePtr,
Type *StoreTy,
const DataLayout &DL) { … }
static Value *getAvailableLoadStore(Instruction *Inst, const Value *Ptr,
Type *AccessTy, bool AtLeastAtomic,
const DataLayout &DL, bool *IsLoadCSE) { … }
Value *llvm::findAvailablePtrLoadStore(
const MemoryLocation &Loc, Type *AccessTy, bool AtLeastAtomic,
BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan,
BatchAAResults *AA, bool *IsLoadCSE, unsigned *NumScanedInst) { … }
Value *llvm::FindAvailableLoadedValue(LoadInst *Load, BatchAAResults &AA,
bool *IsLoadCSE,
unsigned MaxInstsToScan) { … }
static bool isPointerUseReplacable(const Use &U) { … }
static bool isPointerAlwaysReplaceable(const Value *From, const Value *To,
const DataLayout &DL) { … }
bool llvm::canReplacePointersInUseIfEqual(const Use &U, const Value *To,
const DataLayout &DL) { … }
bool llvm::canReplacePointersIfEqual(const Value *From, const Value *To,
const DataLayout &DL) { … }
bool llvm::isDereferenceableReadOnlyLoop(
Loop *L, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC,
SmallVectorImpl<const SCEVPredicate *> *Predicates) { … }