[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
Mon Jun 5 11:09:07 PDT 2023
goldstein.w.n updated this revision to Diff 528521.
goldstein.w.n added a comment.
Actual commit
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.528521.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230605/04686bfd/attachment.bin>
More information about the llvm-commits
mailing list