Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/Analysis/MemoryDependenceAnalysis.h
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | Instruction *getInst() const { | ||||
if (Value.getInt() == Other) return nullptr; | if (Value.getInt() == Other) return nullptr; | ||||
return Value.getPointer(); | return Value.getPointer(); | ||||
} | } | ||||
bool operator==(const MemDepResult &M) const { return Value == M.Value; } | bool operator==(const MemDepResult &M) const { return Value == M.Value; } | ||||
bool operator!=(const MemDepResult &M) const { return Value != M.Value; } | bool operator!=(const MemDepResult &M) const { return Value != M.Value; } | ||||
bool operator<(const MemDepResult &M) const { return Value < M.Value; } | bool operator<(const MemDepResult &M) const { return Value < M.Value; } | ||||
bool operator>(const MemDepResult &M) const { return Value > M.Value; } | bool operator>(const MemDepResult &M) const { return Value > M.Value; } | ||||
void print(raw_ostream &OS, unsigned Depth = 0) const; | |||||
private: | private: | ||||
friend class MemoryDependenceAnalysis; | friend class MemoryDependenceAnalysis; | ||||
/// Dirty - Entries with this marker occur in a LocalDeps map or | /// Dirty - Entries with this marker occur in a LocalDeps map or | ||||
/// NonLocalDeps map when the instruction they previously referenced was | /// NonLocalDeps map when the instruction they previously referenced was | ||||
/// removed from MemDep. In either case, the entry may include an | /// removed from MemDep. In either case, the entry may include an | ||||
/// instruction pointer. If so, the pointer is an instruction in the | /// instruction pointer. If so, the pointer is an instruction in the | ||||
/// block where scanning can start from, saving some work. | /// block where scanning can start from, saving some work. | ||||
/// | /// | ||||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | private: | ||||
// A reverse mapping from dependencies to the non-local dependees. | // A reverse mapping from dependencies to the non-local dependees. | ||||
ReverseDepMapType ReverseNonLocalDeps; | ReverseDepMapType ReverseNonLocalDeps; | ||||
/// Current AA implementation, just a cache. | /// Current AA implementation, just a cache. | ||||
AliasAnalysis *AA; | AliasAnalysis *AA; | ||||
DominatorTree *DT; | DominatorTree *DT; | ||||
AssumptionCache *AC; | AssumptionCache *AC; | ||||
std::unique_ptr<PredIteratorCache> PredCache; | std::unique_ptr<PredIteratorCache> PredCache; | ||||
Function *Func; | |||||
public: | public: | ||||
MemoryDependenceAnalysis(); | MemoryDependenceAnalysis(); | ||||
~MemoryDependenceAnalysis(); | ~MemoryDependenceAnalysis(); | ||||
static char ID; | static char ID; | ||||
/// Pass Implementation stuff. This doesn't do any analysis eagerly. | /// Pass Implementation stuff. This doesn't do any analysis eagerly. | ||||
bool runOnFunction(Function &) override; | bool runOnFunction(Function &) override; | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | public: | ||||
/// 2) safe for the target, and 3) would provide the specified memory | /// 2) safe for the target, and 3) would provide the specified memory | ||||
/// location value, then this function returns the size in bytes of the | /// location value, then this function returns the size in bytes of the | ||||
/// load width to use. If not, this returns zero. | /// load width to use. If not, this returns zero. | ||||
static unsigned getLoadLoadClobberFullWidthSize(const Value *MemLocBase, | static unsigned getLoadLoadClobberFullWidthSize(const Value *MemLocBase, | ||||
int64_t MemLocOffs, | int64_t MemLocOffs, | ||||
unsigned MemLocSize, | unsigned MemLocSize, | ||||
const LoadInst *LI); | const LoadInst *LI); | ||||
/// \brief Print the result of the analysis when invoked with -analyze. | |||||
void print(raw_ostream &OS, const Module *M = nullptr) const override; | |||||
private: | private: | ||||
MemDepResult getCallSiteDependencyFrom(CallSite C, bool isReadOnlyCall, | MemDepResult getCallSiteDependencyFrom(CallSite C, bool isReadOnlyCall, | ||||
BasicBlock::iterator ScanIt, | BasicBlock::iterator ScanIt, | ||||
BasicBlock *BB); | BasicBlock *BB); | ||||
bool getNonLocalPointerDepFromBB(Instruction *QueryInst, | bool getNonLocalPointerDepFromBB(Instruction *QueryInst, | ||||
const PHITransAddr &Pointer, | const PHITransAddr &Pointer, | ||||
const AliasAnalysis::Location &Loc, | const AliasAnalysis::Location &Loc, | ||||
bool isLoad, BasicBlock *BB, | bool isLoad, BasicBlock *BB, | ||||
Show All 20 Lines |