зеркало из https://github.com/mozilla/gecko-dev.git
Bug 820676: Minor improvement. r=luke
This commit is contained in:
Родитель
010027f7be
Коммит
7113c82fe3
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче