[PATCH] D115480: [InstCombine] Fold icmp of truncated left shift

Hasyimi Bahrudin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 16:16:43 PST 2021


hasyimibhar created this revision.
Herald added a subscriber: hiraditya.
hasyimibhar requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Folds:

- (icmp eq (trunc (shl 1, Y) to i[N]), 0) --> (icmp ugt Y, N-1)
- (icmp ne (trunc (shl 1, Y) to i[N]), 0) --> (icmp ult Y, N)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115480

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/icmp-trunc-shl.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115480.393327.patch
Type: text/x-patch
Size: 8877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211210/d4e8482a/attachment.bin>


More information about the llvm-commits mailing list