14 #ifndef MLIR_ANALYSIS_ALIASANALYSIS_H_ 15 #define MLIR_ANALYSIS_ALIASANALYSIS_H_ 49 explicit operator bool()
const {
return kind !=
NoAlias; }
71 void print(raw_ostream &os)
const;
126 LLVM_NODISCARD
bool isNoModRef()
const {
return kind == Kind::NoModRef; }
130 return static_cast<int>(kind) & static_cast<int>(
Kind::Mod);
135 return static_cast<int>(kind) & static_cast<int>(Kind::Ref);
139 LLVM_NODISCARD
bool isModOrRef()
const {
return kind != Kind::NoModRef; }
142 LLVM_NODISCARD
bool isModAndRef()
const {
return kind == Kind::ModRef; }
146 return ModRefResult(static_cast<Kind>(static_cast<int>(kind) |
147 static_cast<int>(other.kind)));
151 return ModRefResult(static_cast<Kind>(static_cast<int>(kind) &
152 static_cast<int>(other.kind)));
156 void print(raw_ostream &os)
const;
199 ~
Model()
override =
default;
203 return impl.alias(lhs, rhs);
208 return impl.getModRef(op, location);
233 template <
typename ImplT>
256 template <
typename AnalysisT>
258 aliasImpls.push_back(
283 #endif // MLIR_ANALYSIS_ALIASANALYSIS_H_ Include the generated interface declarations.
static ModRefResult getRef()
Return a new result that indicates that the memory access may reference the value stored in memory...
bool isPartial() const
Returns if this result is a partial alias.
RHS of mod is always a constant or a symbolic expression with a positive value.
Operation is a basic unit of execution within MLIR.
The possible results of an alias query.
LLVM_NODISCARD bool isModOrRef() const
Returns if this result modifies or references memory.
ModRefResult intersect(const ModRefResult &other)
Intersect this ModRef result with other and return the result.
The two locations precisely alias each other.
The two locations alias, but only due to a partial overlap.
The possible results of whether a memory access modifies or references a memory location.
bool isMust() const
Returns if this result is a must alias.
raw_ostream & operator<<(raw_ostream &os, const AliasResult &result)
LLVM_NODISCARD bool isRef() const
Returns if this result references memory.
AliasResult alias(Value lhs, Value rhs) final
Given two values, return their aliasing behavior.
This class contains various internal trait classes used by the main AliasAnalysis class below...
LLVM_NODISCARD bool isMod() const
Returns if this result modifies memory.
void print(raw_ostream &os) const
Print this ModRef result to the provided output stream.
This class represents the Model of an alias analysis implementation ImplT.
ModRefResult getModRef(Operation *op, Value location) final
Return the modify-reference behavior of op on location.
bool isMay() const
Returns if this result is a may alias.
This class represents the main alias analysis interface in MLIR.
bool isNo() const
Returns if this result is a partial alias.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
The two locations do not alias at all.
AliasResult merge(AliasResult other) const
Merge this alias result with other and return a new result that represents the conservative merge of ...
static ModRefResult getMod()
Return a new result that indicates that the memory access may modify the value stored in memory...
static ModRefResult getNoModRef()
Return a new result that indicates that the memory access neither references nor modifies the value s...
ModRefResult merge(const ModRefResult &other)
Merge this ModRef result with other and return the result.
void print(raw_ostream &os) const
Print this alias result to the provided output stream.
LLVM_NODISCARD bool isNoModRef() const
Returns if this result does not modify or reference memory.
bool operator==(const ModRefResult &rhs) const
void addAnalysisImplementation(AnalysisT &&analysis)
Add a new alias analysis implementation AnalysisT to this analysis aggregate.
bool operator!=(const ModRefResult &rhs) const
The two locations may or may not alias.
LLVM_NODISCARD bool isModAndRef() const
Returns if this result modifies and references memory.
This class represents the Concept of an alias analysis implementation.
bool operator==(const AliasResult &other) const
bool operator!=(const AliasResult &other) const
static ModRefResult getModAndRef()
Return a new result that indicates that the memory access may reference and may modify the value stor...