X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FMemoryDependenceAnalysis.cpp;h=f7180aae69edcfa789fa9263e888a8973e0873ef;hb=3666e7f4c161c50e5f6dcb0e015ca16bf69fb941;hp=aef241840acdf567991bf84ce927eef1799cb5c0;hpb=217b38e19adffd8147b16f3dcace8b51634ae21c;p=oota-llvm.git diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index aef241840ac..f7180aae69e 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -449,12 +449,16 @@ getPointerDependencyFrom(const AliasAnalysis::Location &MemLoc, bool isLoad, if (!LI->isUnordered()) { if (!QueryInst) return MemDepResult::getClobber(LI); - if (auto *QueryLI = dyn_cast(QueryInst)) + if (auto *QueryLI = dyn_cast(QueryInst)) { if (!QueryLI->isSimple()) return MemDepResult::getClobber(LI); - if (auto *QuerySI = dyn_cast(QueryInst)) + } else if (auto *QuerySI = dyn_cast(QueryInst)) { if (!QuerySI->isSimple()) return MemDepResult::getClobber(LI); + } else if (QueryInst->mayReadOrWriteMemory()) { + return MemDepResult::getClobber(LI); + } + if (isAtLeastAcquire(LI->getOrdering())) HasSeenAcquire = true; } @@ -529,12 +533,16 @@ getPointerDependencyFrom(const AliasAnalysis::Location &MemLoc, bool isLoad, if (!SI->isUnordered()) { if (!QueryInst) return MemDepResult::getClobber(SI); - if (auto *QueryLI = dyn_cast(QueryInst)) + if (auto *QueryLI = dyn_cast(QueryInst)) { if (!QueryLI->isSimple()) return MemDepResult::getClobber(SI); - if (auto *QuerySI = dyn_cast(QueryInst)) + } else if (auto *QuerySI = dyn_cast(QueryInst)) { if (!QuerySI->isSimple()) return MemDepResult::getClobber(SI); + } else if (QueryInst->mayReadOrWriteMemory()) { + return MemDepResult::getClobber(SI); + } + if (HasSeenAcquire && isAtLeastRelease(SI->getOrdering())) return MemDepResult::getClobber(SI); }