Go to the documentation of this file.
69 if (!isa<SCEVCouldNotCompute>(BA) &&
84 if (!isa<SCEVCouldNotCompute>(AB) &&
93 Value *AO = GetBaseValue(AS);
94 Value *BO = GetBaseValue(BS);
95 if ((AO && AO != LocA.
Ptr) || (BO && BO != LocB.
Ptr))
114 Value *SCEVAAResult::GetBaseValue(
const SCEV *
S) {
118 return GetBaseValue(AR->getStart());
119 }
else if (
const SCEVAddExpr *A = dyn_cast<SCEVAddExpr>(
S)) {
121 const SCEV *Last = A->getOperand(A->getNumOperands() - 1);
122 if (Last->getType()->isPointerTy())
123 return GetBaseValue(Last);
124 }
else if (
const SCEVUnknown *U = dyn_cast<SCEVUnknown>(
S)) {
126 return U->getValue();
147 "ScalarEvolution-based Alias Analysis",
false,
true)
162 new SCEVAAResult(getAnalysis<ScalarEvolutionWrapperPass>().getSE()));
A set of analyses that are preserved following a run of a transformation pass.
Analysis pass that exposes the ScalarEvolution for a function.
This is an optimization pass for GlobalISel generic memory operations.
Type * getEffectiveSCEVType(Type *Ty) const
Return a type with the same bitwidth as the given type and which represents how SCEV will treat the g...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
const Value * Ptr
The address of the start of the location.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
bool ule(const APInt &RHS) const
Unsigned less or equal comparison.
The main scalar evolution driver.
uint64_t getTypeSizeInBits(Type *Ty) const
Return the size in bits of the specified type, for which isSCEVable must return true.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
LocationSize Size
The maximum size of the location, in address-units, or UnknownSize if the size is not known.
INITIALIZE_PASS_BEGIN(SCEVAAWrapperPass, "scev-aa", "ScalarEvolution-based Alias Analysis", false, true) INITIALIZE_PASS_END(SCEVAAWrapperPass
SCEVAAResult run(Function &F, FunctionAnalysisManager &AM)
The possible results of an alias query.
This class stores info we want to provide to or retain within an alias query.
AAMDNodes AATags
The metadata nodes which describes the aliasing of the location (each member is null if that kind of ...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
APInt getUnsignedMin() const
Return the smallest unsigned value contained in the ConstantRange.
Represent the analysis usage information of a pass.
uint64_t getValue() const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
APInt getUnsignedMax() const
Return the largest unsigned value contained in the ConstantRange.
API to communicate dependencies between analyses during invalidation.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
This class represents an analyzed expression in the program.
Legacy wrapper pass to provide the SCEVAAResult object.
bool instructionCouldExistWitthOperands(const SCEV *A, const SCEV *B)
Return true if there exists a point in the program at which both A and B could be operands to the sam...
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
A special type used by analysis passes to provide an address that identifies that particular analysis...
ConstantRange getUnsignedRange(const SCEV *S)
Determine the unsigned range for a particular SCEV.
Class for arbitrary precision integers.
void initializeSCEVAAWrapperPassPass(PassRegistry &)
@ NoAlias
The two locations do not alias at all.
@ MustAlias
The two locations precisely alias each other.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
const SCEV * getMinusSCEV(const SCEV *LHS, const SCEV *RHS, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Return LHS-RHS.
static bool canComputePointerDiff(ScalarEvolution &SE, const SCEV *A, const SCEV *B)
void setPreservesAll()
Set by analyses that do not transform their input at all.
constexpr static LocationSize beforeOrAfterPointer()
Any location before or after the base pointer (but still within the underlying object).
This node represents a polynomial recurrence on the trip count of the specified loop.
constexpr unsigned BitWidth
This means that we are dealing with an entirely unknown SCEV value, and only represent it as its LLVM...
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
This node represents an addition of some number of SCEVs.
A simple alias analysis implementation that uses ScalarEvolution to answer queries.
Type * getType() const
Return the LLVM type of this SCEV expression.
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
AnalysisUsage & addRequired()
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
LLVM Value Representation.
Representation for a specific memory location.