This is not true: (X != 13 | X < 15) -> X < 15
authorChris Lattner <sabre@nondot.org>
Fri, 17 Jun 2005 03:59:17 +0000 (03:59 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 17 Jun 2005 03:59:17 +0000 (03:59 +0000)
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

index d2827af3d74def1f6026682d295f7390cd576cdc..83998c8bc2da6f3e377d1d2b5368e54800125a05 100644 (file)
@@ -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;