[PATCH] D152181: [InstCombine] Remove deadcode in `(icmp SignTest(shl/shr X))`; NFC

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 13:14:34 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe387f49d133d: [InstCombine] Remove deadcode in `(icmp SignTest(shl/shr X))`; NFC (authored by goldstein.w.n).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152181/new/

https://reviews.llvm.org/D152181

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp


Index: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2251,11 +2251,6 @@
       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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152181.529009.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230606/a59b178c/attachment.bin>


More information about the llvm-commits mailing list