Don't call dominates on unreachable instructions. Should fix the dragonegg

build. Testcase is still reducing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2012-02-26 05:30:08 +00:00
parent 34674743f5
commit 5465c9422f

View File

@ -350,14 +350,18 @@ namespace {
bool shouldExplore(Use *U) {
Instruction *I = cast<Instruction>(U->getUser());
if (BeforeHere != I && DT->dominates(BeforeHere, I))
BasicBlock *BB = I->getParent();
if (BeforeHere != I &&
(!DT->isReachableFromEntry(BB) || DT->dominates(BeforeHere, I)))
return false;
return true;
}
bool captured(Use *U) {
Instruction *I = cast<Instruction>(U->getUser());
if (BeforeHere != I && DT->dominates(BeforeHere, I))
BasicBlock *BB = I->getParent();
if (BeforeHere != I &&
(!DT->isReachableFromEntry(BB) || DT->dominates(BeforeHere, I)))
return false;
Captured = true;
return true;