LLVM 20.0.0git
Functions
Loads.cpp File Reference
#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"

Go to the source code of this file.

Functions

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)
 Test if V is always a pointer to allocated and suitably aligned memory for a simple load or store.
 
static bool AreEquivalentAddressValues (const Value *A, const Value *B)
 Test if A and B will obviously have the same value.
 
static bool suppressSpeculativeLoadForSanitizers (const Instruction &CtxI)
 
static bool areNonOverlapSameBaseLoadAndStore (const Value *LoadPtr, Type *LoadTy, const Value *StorePtr, Type *StoreTy, const DataLayout &DL)
 
static ValuegetAvailableLoadStore (Instruction *Inst, const Value *Ptr, Type *AccessTy, bool AtLeastAtomic, const DataLayout &DL, bool *IsLoadCSE)
 
static bool isPointerUseReplacable (const Use &U)
 
static bool isPointerAlwaysReplaceable (const Value *From, const Value *To, const DataLayout &DL)
 

Function Documentation

◆ AreEquivalentAddressValues()

static bool AreEquivalentAddressValues ( const Value A,
const Value B 
)
static

Test if A and B will obviously have the same value.

This includes recognizing that t0 and t1 will have the same value in code like this:

%t0 = getelementptr \@a, 0, 3
store i32 0, i32* %t0
%t1 = getelementptr \@a, 0, 3
%t2 = load i32* %t1
AMDGPU Mark last scratch load

Definition at line 242 of file Loads.cpp.

References A, and B.

Referenced by getAvailableLoadStore(), and llvm::isSafeToLoadUnconditionally().

◆ areNonOverlapSameBaseLoadAndStore()

static bool areNonOverlapSameBaseLoadAndStore ( const Value LoadPtr,
Type LoadTy,
const Value StorePtr,
Type StoreTy,
const DataLayout DL 
)
static

◆ getAvailableLoadStore()

static Value * getAvailableLoadStore ( Instruction Inst,
const Value Ptr,
Type AccessTy,
bool  AtLeastAtomic,
const DataLayout DL,
bool IsLoadCSE 
)
static

◆ isAligned()

static bool isAligned ( const Value Base,
const APInt Offset,
Align  Alignment,
const DataLayout DL 
)
static

Definition at line 29 of file Loads.cpp.

References llvm::sampleprof::Base, DL, and llvm::Offset.

Referenced by isDereferenceableAndAlignedPointer().

◆ isDereferenceableAndAlignedPointer()

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 
)
static

◆ isPointerAlwaysReplaceable()

static bool isPointerAlwaysReplaceable ( const Value From,
const Value To,
const DataLayout DL 
)
static

◆ isPointerUseReplacable()

static bool isPointerUseReplacable ( const Use U)
static

◆ suppressSpeculativeLoadForSanitizers()

static bool suppressSpeculativeLoadForSanitizers ( const Instruction CtxI)
static