this can be trunc or bitcast, per line 3092.
authorChris Lattner <sabre@nondot.org>
Tue, 12 Dec 2006 19:11:20 +0000 (19:11 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 12 Dec 2006 19:11:20 +0000 (19:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32487 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index d15a843d4086561003022008f16d1a2e9a50594e..a1ed221a7e1bb522623d981a9ab88d0e5b36763e 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::getTrunc(AndCI, I.getType());
+              Constant *C3 = ConstantExpr::getTruncOrBitCast(AndCI,I.getType());
               if (ConstantExpr::getAnd(C3, AndRHS) == AndRHS)   // trunc(C1)&C2
                 return ReplaceInstUsesWith(I, AndRHS);
             }