[InstCombine] Remove deadcode in `(icmp SignTest(shl/shr X))`; NFC
authorNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 6 Jun 2023 19:07:30 +0000 (14:07 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 6 Jun 2023 20:14:10 +0000 (15:14 -0500)
This is dead as of: D145341

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D152181

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

index e80d69c..0865de3 100644 (file)
@@ -2251,11 +2251,6 @@ Instruction *InstCombinerImpl::foldICmpShlConstant(ICmpInst &Cmp,
       APInt ShiftedC = (C - 1).ashr(*ShiftAmt) + 1;
       return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
     }
-    // If this is a signed comparison to 0 and the shift is sign preserving,
-    // use the shift LHS operand instead; isSignTest may change 'Pred', so only
-    // do that if we're sure to not continue on in this function.
-    if (isSignTest(Pred, C))
-      return new ICmpInst(Pred, X, Constant::getNullValue(ShType));
   }
 
   // NUW guarantees that we are only shifting out zero bits from the high bits,