diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-08-15 20:54:19 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-08-15 20:54:19 +0000 |
commit | 667ccf231b57857ea9e36f1d93bd895242d58284 (patch) | |
tree | 2fb62ad6e8f5bb11cc1247e3bc31ee99f5eeea99 /lib/Analysis/MemDepPrinter.cpp | |
parent | 47a24ab4d72dc0f78c2027327cb9a69d6de2bbcd (diff) |
Misc analysis passes that need to be aware of atomic load/store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemDepPrinter.cpp')
-rw-r--r-- | lib/Analysis/MemDepPrinter.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Analysis/MemDepPrinter.cpp b/lib/Analysis/MemDepPrinter.cpp index 2283db0bc4..dc40da012c 100644 --- a/lib/Analysis/MemDepPrinter.cpp +++ b/lib/Analysis/MemDepPrinter.cpp @@ -102,12 +102,21 @@ bool MemDepPrinter::runOnFunction(Function &F) { } else { SmallVector<NonLocalDepResult, 4> NLDI; if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) { - // FIXME: Volatile is not handled properly here. + if (!LI->isUnordered()) { + // FIXME: Handle atomic/volatile loads. + Deps[Inst].insert(std::make_pair(InstAndClobberFlag(0, false), + static_cast<BasicBlock *>(0))); + continue; + } AliasAnalysis::Location Loc = AA.getLocation(LI); - MDA.getNonLocalPointerDependency(Loc, !LI->isVolatile(), - LI->getParent(), NLDI); + MDA.getNonLocalPointerDependency(Loc, true, LI->getParent(), NLDI); } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) { - // FIXME: Volatile is not handled properly here. + if (!LI->isUnordered()) { + // FIXME: Handle atomic/volatile stores. + Deps[Inst].insert(std::make_pair(InstAndClobberFlag(0, false), + static_cast<BasicBlock *>(0))); + continue; + } AliasAnalysis::Location Loc = AA.getLocation(SI); MDA.getNonLocalPointerDependency(Loc, false, SI->getParent(), NLDI); } else if (VAArgInst *VI = dyn_cast<VAArgInst>(Inst)) { |