1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fix a really nasty caching bug I introduced in memdep. An entry

was being added to the Result vector, but not being put in the
cache.  This means that if the cache was reused wholesale for a
later query that it would be missing this entry and we'd do an
incorrect load elimination.

Unfortunately, it's not really possible to write a useful 
testcase for this, but this unbreaks 255.vortex.

llvm-svn: 90093
This commit is contained in:
Chris Lattner 2009-11-29 21:09:36 +00:00
parent a1d24b5a8d
commit 6155ce3427

View File

@ -1156,8 +1156,18 @@ getNonLocalPointerDepFromBB(Value *Pointer, uint64_t PointeeSize,
// that predecessor. We can still do PRE of the load, which would insert
// a computation of the pointer in this predecessor.
if (PredPtr == 0) {
Result.push_back(NonLocalDepEntry(Pred,
MemDepResult::getClobber(Pred->getTerminator())));
// Add the entry to the Result list.
NonLocalDepEntry Entry(Pred,
MemDepResult::getClobber(Pred->getTerminator()));
Result.push_back(Entry);
// Add it to the cache for this CacheKey so that subsequent queries get
// this result.
Cache = &NonLocalPointerDeps[CacheKey].second;
MemoryDependenceAnalysis::NonLocalDepInfo::iterator It =
std::upper_bound(Cache->begin(), Cache->end(), Entry);
Cache->insert(It, Entry);
Cache = 0;
continue;
}