mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Ignore unreachable blocks when doing memory dependence analysis on non-local
loads. It's not really profitable and may result in GVN going into an infinite loop when it hits constructs like this: %x = gep %some.type %x, ... Found via an LTO build of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -983,7 +983,7 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
|
||||
for (NonLocalDepInfo::iterator I = Cache->begin(), E = Cache->end();
|
||||
I != E; ++I) {
|
||||
Visited.insert(std::make_pair(I->getBB(), Addr));
|
||||
if (!I->getResult().isNonLocal())
|
||||
if (!I->getResult().isNonLocal() && DT->isReachableFromEntry(I->getBB()))
|
||||
Result.push_back(NonLocalDepResult(I->getBB(), I->getResult(), Addr));
|
||||
}
|
||||
++NumCacheCompleteNonLocalPtr;
|
||||
@@ -1029,7 +1029,7 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
|
||||
NumSortedEntries);
|
||||
|
||||
// If we got a Def or Clobber, add this to the list of results.
|
||||
if (!Dep.isNonLocal()) {
|
||||
if (!Dep.isNonLocal() && DT->isReachableFromEntry(BB)) {
|
||||
Result.push_back(NonLocalDepResult(BB, Dep, Pointer.getAddr()));
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user