diff options
author | Philip Reames <listmail@philipreames.com> | 2015-01-09 00:26:45 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2015-01-09 00:26:45 +0000 |
commit | 33d7f9de332701294f6528ae7151bc40ba008737 (patch) | |
tree | 80d87d15adc64f4a3cfc6526f8f07f87fb2fafed /llvm/lib/Analysis/MemDepPrinter.cpp | |
parent | becb60ffd9e9d0147a4136330f527009ee10c7ec (diff) | |
download | bcm5719-llvm-33d7f9de332701294f6528ae7151bc40ba008737.tar.gz bcm5719-llvm-33d7f9de332701294f6528ae7151bc40ba008737.zip |
[REFACTOR] Push logic from MemDepPrinter into getNonLocalPointerDependency
Previously, MemDepPrinter handled volatile and unordered accesses without involving MemoryDependencyAnalysis. By making a slight tweak to the documented interface - which is respected by both callers - we can move this responsibility to MDA for the benefit of any future callers. This is basically just cleanup.
In the future, we may decide to extend MDA's non local dependency analysis to return useful results for ordered or volatile loads. I believe (but have not really checked in detail) that local dependency analyis does get useful results for ordered, but not volatile, loads.
llvm-svn: 225483
Diffstat (limited to 'llvm/lib/Analysis/MemDepPrinter.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemDepPrinter.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/llvm/lib/Analysis/MemDepPrinter.cpp b/llvm/lib/Analysis/MemDepPrinter.cpp index ed77da02690..ffc9fe64cc5 100644 --- a/llvm/lib/Analysis/MemDepPrinter.cpp +++ b/llvm/lib/Analysis/MemDepPrinter.cpp @@ -118,27 +118,9 @@ bool MemDepPrinter::runOnFunction(Function &F) { } } else { SmallVector<NonLocalDepResult, 4> NLDI; - if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) { - if (!LI->isUnordered()) { - // FIXME: Handle atomic/volatile loads. - Deps[Inst].insert(std::make_pair(getInstTypePair(nullptr, Unknown), - static_cast<BasicBlock *>(nullptr))); - continue; - } - MDA.getNonLocalPointerDependency(LI, NLDI); - } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) { - if (!SI->isUnordered()) { - // FIXME: Handle atomic/volatile stores. - Deps[Inst].insert(std::make_pair(getInstTypePair(nullptr, Unknown), - static_cast<BasicBlock *>(nullptr))); - continue; - } - MDA.getNonLocalPointerDependency(SI, NLDI); - } else if (VAArgInst *VI = dyn_cast<VAArgInst>(Inst)) { - MDA.getNonLocalPointerDependency(VI, NLDI); - } else { - llvm_unreachable("Unknown memory instruction!"); - } + assert( (isa<LoadInst>(Inst) || isa<StoreInst>(Inst) || + isa<VAArgInst>(Inst)) && "Unknown memory instruction!"); + MDA.getNonLocalPointerDependency(Inst, NLDI); DepSet &InstDeps = Deps[Inst]; for (SmallVectorImpl<NonLocalDepResult>::const_iterator |