From e88b7533be3c0e6072b3a3d672bae464f33b090a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 17 Jun 2005 03:59:17 +0000 Subject: [PATCH] This is not true: (X != 13 | X < 15) -> X < 15 It is actually always true. This fixes PR586 and Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22236 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index d2827af3d74..83998c8bc2d 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1967,12 +1967,11 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) { case Instruction::SetNE: switch (RHSCC) { default: assert(0 && "Unknown integer condition code!"); - case Instruction::SetLT: // (X != 13 | X < 15) -> X < 15 - return ReplaceInstUsesWith(I, RHS); case Instruction::SetEQ: // (X != 13 | X == 15) -> X != 13 case Instruction::SetGT: // (X != 13 | X > 15) -> X != 13 return ReplaceInstUsesWith(I, LHS); case Instruction::SetNE: // (X != 13 | X != 15) -> true + case Instruction::SetLT: // (X != 13 | X < 15) -> true return ReplaceInstUsesWith(I, ConstantBool::True); } break;