mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Common some code from MemoryDependenceAnalysis that will be used in MemorySSA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -874,23 +874,7 @@ MemoryDependenceAnalysis::getNonLocalCallDependency(CallSite QueryCS) {
|
||||
void MemoryDependenceAnalysis::
|
||||
getNonLocalPointerDependency(Instruction *QueryInst,
|
||||
SmallVectorImpl<NonLocalDepResult> &Result) {
|
||||
|
||||
auto getLocation = [](AliasAnalysis *AA, Instruction *Inst) {
|
||||
if (auto *I = dyn_cast<LoadInst>(Inst))
|
||||
return AA->getLocation(I);
|
||||
else if (auto *I = dyn_cast<StoreInst>(Inst))
|
||||
return AA->getLocation(I);
|
||||
else if (auto *I = dyn_cast<VAArgInst>(Inst))
|
||||
return AA->getLocation(I);
|
||||
else if (auto *I = dyn_cast<AtomicCmpXchgInst>(Inst))
|
||||
return AA->getLocation(I);
|
||||
else if (auto *I = dyn_cast<AtomicRMWInst>(Inst))
|
||||
return AA->getLocation(I);
|
||||
else
|
||||
llvm_unreachable("unsupported memory instruction");
|
||||
};
|
||||
|
||||
const AliasAnalysis::Location Loc = getLocation(AA, QueryInst);
|
||||
const AliasAnalysis::Location Loc = AA->getLocation(QueryInst);
|
||||
bool isLoad = isa<LoadInst>(QueryInst);
|
||||
BasicBlock *FromBB = QueryInst->getParent();
|
||||
assert(FromBB);
|
||||
|
Reference in New Issue
Block a user