LLVM 17.0.0git
|
#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 | 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) |
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:
Definition at line 242 of file Loads.cpp.
Referenced by getAvailableLoadStore(), and llvm::isSafeToLoadUnconditionally().
|
static |
Definition at line 453 of file Loads.cpp.
References DL, llvm::Value::getType(), llvm::ConstantRange::intersectWith(), llvm::ConstantRange::isEmptySet(), llvm::LocationSize::precise(), and llvm::Value::stripAndAccumulateConstantOffsets().
Referenced by llvm::findAvailablePtrLoadStore().
|
static |
Definition at line 475 of file Loads.cpp.
References AreEquivalentAddressValues(), llvm::CallingConv::C, llvm::ConstantFoldLoadFromConst(), DL, llvm::ConstantInt::get(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::APInt::getSplat(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::CastInst::isBitOrNoopPointerCastable(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), Ptr, SI, and llvm::Value::stripPointerCasts().
Referenced by llvm::FindAvailableLoadedValue(), and llvm::findAvailablePtrLoadStore().
|
static |
Definition at line 29 of file Loads.cpp.
References assert(), llvm::sampleprof::Base, DL, llvm::APInt::isPowerOf2(), llvm::Offset, and llvm::Align::value().
Referenced by isDereferenceableAndAlignedPointer().
|
static |
Test if V is always a pointer to allocated and suitably aligned memory for a simple load or store.
TODO refactor this function to be able to search independently for Dereferencability and Alignment requirements.
Look through assumes to see if both dereferencability and alignment can be provent by an assume
Definition at line 39 of file Loads.cpp.
References llvm::RetainedKnowledge::ArgValue, assert(), llvm::sampleprof::Base, DL, GEP, llvm::getArgumentAliasingToReturnedPointer(), llvm::APInt::getBoolValue(), llvm::getKnowledgeForValue(), llvm::getObjectSize(), if(), llvm::SmallPtrSetImpl< PtrType >::insert(), isAligned(), isDereferenceableAndAlignedPointer(), llvm::isKnownNonZero(), llvm::isValidAssumeForContext(), MaxDepth, llvm::ObjectSizeOpts::NullIsUnknownSize, llvm::Offset, llvm::ObjectSizeOpts::RoundToAlign, Size, llvm::APInt::uge(), and llvm::Align::value().
Referenced by llvm::canReplacePointersIfEqual(), llvm::isDereferenceableAndAlignedInLoop(), isDereferenceableAndAlignedPointer(), llvm::isDereferenceableAndAlignedPointer(), llvm::isDereferenceablePointer(), and llvm::isSafeToLoadUnconditionally().