From d683bdd0f85d679dae2dfc19702cbd62e8e509d2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 3 Aug 2005 17:59:45 +0000 Subject: Fix Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll, a problem that occurred while bugpointing another testcase llvm-svn: 22621 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Utils') diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 742efe61844..2bf9ae89f9f 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -805,7 +805,7 @@ static bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI) { return Changed; } -/// HoistThenElseCodeToIf - Given a conditional branch that codes to BB1 and +/// HoistThenElseCodeToIf - Given a conditional branch that goes to BB1 and /// BB2, hoist any common code in the two blocks up into the branch block. The /// caller of this function guarantees that BI's block dominates BB1 and BB2. static bool HoistThenElseCodeToIf(BranchInst *BI) { @@ -818,7 +818,8 @@ static bool HoistThenElseCodeToIf(BranchInst *BI) { BasicBlock *BB2 = BI->getSuccessor(1); // The false destination Instruction *I1 = BB1->begin(), *I2 = BB2->begin(); - if (I1->getOpcode() != I2->getOpcode() || !I1->isIdenticalTo(I2)) + if (I1->getOpcode() != I2->getOpcode() || !I1->isIdenticalTo(I2) || + isa(I1)) return false; // If we get here, we can hoist at least one instruction. -- cgit v1.2.3