summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-06-02 00:08:52 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-06-02 00:08:52 +0000
commitb576b1675c9cb19f175e20633dd24e8b5ec26a24 (patch)
tree6e485537a5149dbc68d96bf950b32069338a4fe6 /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parentf7626eff37fd020265c60c66e288002aa49eeb15 (diff)
downloadbcm5719-llvm-b576b1675c9cb19f175e20633dd24e8b5ec26a24.tar.gz
bcm5719-llvm-b576b1675c9cb19f175e20633dd24e8b5ec26a24.zip
When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block. This is a bit of a hack; "Clobber" isn't really the right marking in the first place. memdep doesn't really have any way of properly expressing "unanalyzable" at the moment. Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though.
In the given testcase, the "Clobber" was pointing to a load, and GVN was incorrectly assuming that meant that the "Clobber" load overlapped the load being analyzed (when they are actually unrelated). The included testcase tests both this commit and r132434. Part two of rdar://9429882. (r132434 was mislabeled.) llvm-svn: 132442
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index e854f7c068e..a412425770f 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -1155,8 +1155,8 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
assert(I->getResult().isNonLocal() &&
"Should only be here with transparent block");
- I->setResult(MemDepResult::getClobber(BB->begin()));
- ReverseNonLocalPtrDeps[BB->begin()].insert(CacheKey);
+ I->setResult(MemDepResult::getClobber(BB->getTerminator()));
+ ReverseNonLocalPtrDeps[BB->getTerminator()].insert(CacheKey);
Result.push_back(NonLocalDepResult(I->getBB(), I->getResult(),
Pointer.getAddr()));
break;
OpenPOWER on IntegriCloud