Fix bug: InstCombine/2003-06-05-BranchInvertInfLoop.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-06-05 20:12:51 +00:00
parent d8c1d7619c
commit 9b5fd22bd9

View File

@ -1072,7 +1072,7 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) {
Instruction *InstCombiner::visitBranchInst(BranchInst &BI) {
// Change br (not X), label True, label False to: br X, label False, True
if (BI.isConditional())
if (BI.isConditional() && !isa<Constant>(BI.getCondition()))
if (Value *V = dyn_castNotVal(BI.getCondition())) {
BasicBlock *TrueDest = BI.getSuccessor(0);
BasicBlock *FalseDest = BI.getSuccessor(1);