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

build. Testcase is still reducing.

llvm-svn: 151474
This commit is contained in:
Rafael Espindola 2012-02-26 05:30:08 +00:00
parent a1d6afeddf
commit b660977c67
1 changed files with 6 additions and 2 deletions

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;