aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 978a3db738..14e2c70a8c 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -768,7 +768,9 @@ Instruction *InstCombiner::OptAndOp(Instruction *Op,
ConstantIntegral *AndRHS,
BinaryOperator &TheAnd) {
Value *X = Op->getOperand(0);
- Constant *Together = ConstantExpr::get(Instruction::And, AndRHS, OpRHS);
+ Constant *Together = 0;
+ if (!isa<ShiftInst>(Op))
+ Together = ConstantExpr::get(Instruction::And, AndRHS, OpRHS);
switch (Op->getOpcode()) {
case Instruction::Xor: