30 if (LocA.
Size == 0 || LocB.
Size == 0)
77 Value *AO = GetBaseValue(AS);
78 Value *BO = GetBaseValue(BS);
79 if ((AO && AO != LocA.
Ptr) || (BO && BO != LocB.
Ptr))
95 Value *SCEVAAResult::GetBaseValue(
const SCEV *S) {
99 return GetBaseValue(AR->getStart());
100 }
else if (
const SCEVAddExpr *
A = dyn_cast<SCEVAddExpr>(S)) {
102 const SCEV *Last =
A->getOperand(
A->getNumOperands() - 1);
104 return GetBaseValue(Last);
105 }
else if (
const SCEVUnknown *U = dyn_cast<SCEVUnknown>(S)) {
107 return U->getValue();
121 "ScalarEvolution-based Alias Analysis",
false,
true)
127 return new SCEVAAWrapperPass();
136 new SCEVAAResult(getAnalysis<ScalarEvolutionWrapperPass>().getSE()));
The two locations precisely alias each other.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
scev ScalarEvolution based Alias Analysis
The main scalar evolution driver.
The two locations do not alias at all.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
This is the interface for a SCEV-based alias analysis.
uint64_t getTypeSizeInBits(Type *Ty) const
Return the size in bits of the specified type, for which isSCEVable must return true.
A simple alias analysis implementation that uses ScalarEvolution to answer queries.
This node represents a polynomial recurrence on the trip count of the specified loop.
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
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...
INITIALIZE_PASS_BEGIN(SCEVAAWrapperPass,"scev-aa","ScalarEvolution-based Alias Analysis", false, true) INITIALIZE_PASS_END(SCEVAAWrapperPass
This means that we are dealing with an entirely unknown SCEV value, and only represent it as its LLVM...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs...ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Type * getType() const
Return the LLVM type of this SCEV expression.
AliasResult
The possible results of an alias query.
Represent the analysis usage information of a pass.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
void initializeSCEVAAWrapperPassPass(PassRegistry &)
const SCEV * getMinusSCEV(const SCEV *LHS, const SCEV *RHS, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap)
Return LHS-RHS. Minus is represented in SCEV as A+B*-1.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,"Assign register bank of generic virtual registers", false, false) RegBankSelect
FunctionPass class - This class is used to implement most global optimizations.
bool isPointerTy() const
True if this is an instance of PointerType.
SCEVAAResult run(Function &F, FunctionAnalysisManager &AM)
scev ScalarEvolution based Alias false
const Value * Ptr
The address of the start of the location.
Representation for a specific memory location.
Legacy wrapper pass to provide the SCEVAAResult object.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Class for arbitrary precision integers.
This node represents an addition of some number of SCEVs.
void setPreservesAll()
Set by analyses that do not transform their input at all.
Analysis pass that exposes the ScalarEvolution for a function.
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
AAMDNodes AATags
The metadata nodes which describes the aliasing of the location (each member is null if that kind of ...
This class represents an analyzed expression in the program.
ConstantRange getUnsignedRange(const SCEV *S)
Determine the unsigned range for a particular SCEV.
LLVM Value Representation.
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
A container for analyses that lazily runs them and caches their results.
APInt getUnsignedMax() const
Return the largest unsigned value contained in the ConstantRange.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
bool ule(const APInt &RHS) const
Unsigned less or equal comparison.
A special type used by analysis passes to provide an address that identifies that particular analysis...
APInt getUnsignedMin() const
Return the smallest unsigned value contained in the ConstantRange.
uint64_t Size
The maximum size of the location, in address-units, or UnknownSize if the size is not known...