14 #ifndef LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
15 #define LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
33 class MemoryDependenceAnalysis;
34 class PredIteratorCache;
106 assert(Inst &&
"Def requires inst");
110 assert(Inst &&
"Clobber requires inst");
115 PairTy(reinterpret_cast<Instruction*>(NonLocal), Other));
119 PairTy(reinterpret_cast<Instruction*>(NonFuncLocal), Other));
123 PairTy(reinterpret_cast<Instruction*>(Unknown), Other));
138 return Value.getInt() == Other
145 return Value.getInt() == Other
152 return Value.getInt() == Other
159 if (
Value.getInt() == Other)
return NULL;
160 return Value.getPointer();
181 bool isDirty()
const {
return Value.getInt() ==
Invalid; }
195 : BB(bb), Result(result) {}
220 : Entry(bb, result), Address(address) {}
277 struct NonLocalPointerInfo {
296 NonLocalPointerInfo> CachedNonLocalPointerInfo;
297 CachedNonLocalPointerInfo NonLocalPointerDeps;
302 ReverseNonLocalPtrDepTy ReverseNonLocalPtrDeps;
308 typedef std::pair<NonLocalDepInfo, bool> PerInstNLInfo;
313 NonLocalDepMapType NonLocalDeps;
319 ReverseDepMapType ReverseLocalDeps;
322 ReverseDepMapType ReverseNonLocalDeps;
424 bool getNonLocalPointerDepFromBB(
const PHITransAddr &Pointer,
429 bool SkipFirstBlock =
false);
433 unsigned NumSortedEntries);
void invalidateCachedPointerInfo(Value *Ptr)
BasicBlock * getBB() const
bool operator<(const MemDepResult &M) const
MDNode - a tuple of other values.
void setResult(const MemDepResult &R, Value *Addr)
~MemoryDependenceAnalysis()
LoopInfoBase< BlockT, LoopT > * LI
static MemDepResult getDef(Instruction *Inst)
static unsigned getLoadLoadClobberFullWidthSize(const Value *MemLocBase, int64_t MemLocOffs, unsigned MemLocSize, const LoadInst *LI, const DataLayout &TD)
void getNonLocalPointerDependency(const AliasAnalysis::Location &Loc, bool isLoad, BasicBlock *BB, SmallVectorImpl< NonLocalDepResult > &Result)
Value * getAddress() const
bool runOnFunction(Function &)
Pass Implementation stuff. This doesn't do any analysis eagerly.
bool operator==(const MemDepResult &M) const
MemoryDependenceAnalysis()
static MemDepResult getUnknown()
virtual void getAnalysisUsage(AnalysisUsage &AU) const
LLVM Basic Block Representation.
bool operator>(const MemDepResult &M) const
NonLocalDepResult(BasicBlock *bb, MemDepResult result, Value *address)
static MemDepResult getNonFuncLocal()
BasicBlock * getBB() const
const MemDepResult & getResult() const
void setResult(const MemDepResult &R)
Location - A description of a memory location.
MemDepResult getPointerDependencyFrom(const AliasAnalysis::Location &Loc, bool isLoad, BasicBlock::iterator ScanIt, BasicBlock *BB, Instruction *QueryInst=0)
NonLocalDepEntry(BasicBlock *bb, MemDepResult result)
static MemDepResult getClobber(Instruction *Inst)
std::vector< NonLocalDepEntry > NonLocalDepInfo
bool operator<(const NonLocalDepEntry &RHS) const
Instruction * getInst() const
NonLocalDepEntry(BasicBlock *bb)
MemDepResult getDependency(Instruction *QueryInst)
void invalidateCachedPredecessors()
const NonLocalDepInfo & getNonLocalCallDependency(CallSite QueryCS)
static uint64_t const UnknownSize
LLVM Value Representation.
const MemDepResult & getResult() const
static MemDepResult getNonLocal()
void releaseMemory()
Clean up memory in between runs.
bool isNonFuncLocal() const
bool operator!=(const MemDepResult &M) const
void removeInstruction(Instruction *InstToRemove)