[PATCH] D159329: [InstCombine] Recognize `(icmp eq/ne (and X, ~Mask), 0)` pattern in `foldICmpWithLowBitMaskedVal`
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 18:30:46 PDT 2023
goldstein.w.n created this revision.
goldstein.w.n added reviewers: nikic, RKSimon.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
`(icmp eq/ne (and X, ~Mask), 0)` is equivilent to `(icmp eq/ne (and X,
Mask), X` and we sometimes generate the former pattern intentionally
to reduce number of uses of `X`.
Proof: https://alive2.llvm.org/ce/z/3u-usC
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D159329
Files:
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-and-lowbit-mask.ll
llvm/test/Transforms/InstCombine/lshr-and-negC-icmpeq-zero.ll
llvm/test/Transforms/InstCombine/lshr-and-signbit-icmpeq-zero.ll
llvm/test/Transforms/InstCombine/shl-and-negC-icmpeq-zero.ll
llvm/test/Transforms/InstCombine/shl-and-signbit-icmpeq-zero.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159329.555228.patch
Type: text/x-patch
Size: 12152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230901/2ef61b2b/attachment.bin>
More information about the llvm-commits
mailing list