72 if (!isa<SCEVCouldNotCompute>(AInt) && !isa<SCEVCouldNotCompute>(BInt)) {
83 if (!isa<SCEVCouldNotCompute>(BA) &&
98 if (!isa<SCEVCouldNotCompute>(AB) &&
107 Value *AO = GetBaseValue(AS);
108 Value *BO = GetBaseValue(BS);
109 if ((AO && AO != LocA.
Ptr) || (BO && BO != LocB.
Ptr))
127Value *SCEVAAResult::GetBaseValue(
const SCEV *S) {
131 return GetBaseValue(AR->getStart());
132 }
else if (
const SCEVAddExpr *
A = dyn_cast<SCEVAddExpr>(S)) {
134 const SCEV *
Last =
A->getOperand(
A->getNumOperands() - 1);
135 if (
Last->getType()->isPointerTy())
136 return GetBaseValue(
Last);
137 }
else if (
const SCEVUnknown *U = dyn_cast<SCEVUnknown>(S)) {
139 return U->getValue();
160 "ScalarEvolution-based Alias Analysis",
false,
true)
175 new SCEVAAResult(getAnalysis<ScalarEvolutionWrapperPass>().getSE()));
block Block Frequency Analysis
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
static bool canComputePointerDiff(ScalarEvolution &SE, const SCEV *A, const SCEV *B)
This is the interface for a SCEV-based alias analysis.
This class stores info we want to provide to or retain within an alias query.
Class for arbitrary precision integers.
bool ule(const APInt &RHS) const
Unsigned less or equal comparison.
The possible results of an alias query.
@ MayAlias
The two locations may or may not alias.
@ NoAlias
The two locations do not alias at all.
@ MustAlias
The two locations precisely alias each other.
API to communicate dependencies between analyses during invalidation.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
APInt getUnsignedMin() const
Return the smallest unsigned value contained in the ConstantRange.
APInt getUnsignedMax() const
Return the largest unsigned value contained in the ConstantRange.
FunctionPass class - This class is used to implement most global optimizations.
static constexpr LocationSize beforeOrAfterPointer()
Any location before or after the base pointer (but still within the underlying object).
TypeSize getValue() const
Representation for a specific memory location.
LocationSize Size
The maximum size of the location, in address-units, or UnknownSize if the size is not known.
AAMDNodes AATags
The metadata nodes which describes the aliasing of the location (each member is null if that kind of ...
const Value * Ptr
The address of the start of the location.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
A simple alias analysis implementation that uses ScalarEvolution to answer queries.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI)
Legacy wrapper pass to provide the SCEVAAResult object.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
SCEVAAResult run(Function &F, FunctionAnalysisManager &AM)
This node represents an addition of some number of SCEVs.
This node represents a polynomial recurrence on the trip count of the specified loop.
This means that we are dealing with an entirely unknown SCEV value, and only represent it as its LLVM...
This class represents an analyzed expression in the program.
Type * getType() const
Return the LLVM type of this SCEV expression.
Analysis pass that exposes the ScalarEvolution for a function.
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.
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
const SCEV * getPtrToIntExpr(const SCEV *Op, Type *Ty)
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...
bool instructionCouldExistWithOperands(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...
ConstantRange getUnsignedRange(const SCEV *S)
Determine the unsigned range for a particular SCEV.
const SCEV * getMinusSCEV(const SCEV *LHS, const SCEV *RHS, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Return LHS-RHS.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
void initializeSCEVAAWrapperPassPass(PassRegistry &)
constexpr unsigned BitWidth
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
A special type used by analysis passes to provide an address that identifies that particular analysis...