Do not clone arbitrary condition instructions.

llvm-svn: 13316
This commit is contained in:
Chris Lattner 2004-05-02 05:19:36 +00:00
parent da2d746a3b
commit d8345001fa

View File

@ -806,7 +806,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
// predecessor and use logical operations to pick the right destination.
BasicBlock *TrueDest = BI->getSuccessor(0);
BasicBlock *FalseDest = BI->getSuccessor(1);
if (Instruction *Cond = dyn_cast<Instruction>(BI->getCondition()))
if (BinaryOperator *Cond = dyn_cast<BinaryOperator>(BI->getCondition()))
if (Cond->getParent() == BB && &BB->front() == Cond &&
Cond->getNext() == BI && Cond->hasOneUse() &&
TrueDest != BB && FalseDest != BB)