diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index d38c7c46c2ce..12a886aebe51 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3288,7 +3288,8 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) { Instruction *Add = BinaryOperator::createAdd(LHSVal, AddCST, LHSVal->getName()+".off"); InsertNewInstBefore(Add, I); - return new ICmpInst(ICmpInst::ICMP_UGT, Add, AddCST); + return new ICmpInst(ICmpInst::ICMP_UGT, Add, + ConstantInt::get(Add->getType(), 1)); } break; // (X != 13 & X != 15) -> no change }