Do not clone arbitrary condition instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13316 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-05-02 05:19:36 +00:00
parent 12fe2b1b82
commit bdcc0b8c55

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)