Bug 820676: Minor improvement. r=luke

This commit is contained in:
Nicholas D. Matsakis 2012-12-13 21:43:20 -08:00
Родитель 010027f7be
Коммит 7113c82fe3
1 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -84,16 +84,14 @@ UnreachableCodeElimination::prunePointlessBranchesAndMarkReachableBlocks()
MDefinition *v = testIns->getOperand(0);
if (v->isConstant()) {
const Value &val = v->toConstant()->value();
if (val.isBoolean()) {
BranchDirection bdir = (val.isTrue() ? TRUE_BRANCH : FALSE_BRANCH);
MBasicBlock *succ = testIns->branchSuccessor(bdir);
MGoto *gotoIns = MGoto::New(succ);
block->discardLastIns();
block->end(gotoIns);
MBasicBlock *successorWithPhis = block->successorWithPhis();
if (successorWithPhis && successorWithPhis != succ)
block->setSuccessorWithPhis(NULL, 0);
}
BranchDirection bdir = ToBoolean(val) ? TRUE_BRANCH : FALSE_BRANCH;
MBasicBlock *succ = testIns->branchSuccessor(bdir);
MGoto *gotoIns = MGoto::New(succ);
block->discardLastIns();
block->end(gotoIns);
MBasicBlock *successorWithPhis = block->successorWithPhis();
if (successorWithPhis && successorWithPhis != succ)
block->setSuccessorWithPhis(NULL, 0);
}
}