Fix regression on 400.perlbench last night.
authorChris Lattner <sabre@nondot.org>
Tue, 12 Dec 2006 18:41:03 +0000 (18:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 12 Dec 2006 18:41:03 +0000 (18:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32486 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 57b17a9c72257662655a0665d54dffa63eb4ffc9..d15a843d4086561003022008f16d1a2e9a50594e 100644 (file)
@@ -3112,7 +3112,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
             } else if (CastOp->getOpcode() == Instruction::Or) {
               // Change: and (cast (or X, C1) to T), C2
               // into  : trunc(C1)&C2 iff trunc(C1)&C2 == C2
-              Constant *C3 = ConstantExpr::getBitCast(AndCI, I.getType());
+              Constant *C3 = ConstantExpr::getTrunc(AndCI, I.getType());
               if (ConstantExpr::getAnd(C3, AndRHS) == AndRHS)   // trunc(C1)&C2
                 return ReplaceInstUsesWith(I, AndRHS);
             }