[PATCH] D156058: [InstCombine] Fix bug in canonicalization of Pow2 Tests (From: D152673)

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 23 09:09:15 PDT 2023


goldstein.w.n created this revision.
goldstein.w.n added reviewers: nikic, nlopes.
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.

D152673 <https://reviews.llvm.org/D152673> Incorrectly didn't account for operand position in the `icmp`,
i.e it treated `icmp uge x, y` the same as `icmp uge y, x` which is
incorrect:
https://reviews.llvm.org/rG142f7448e770f25b774b058a7eab1f107c4daad9

The fix takes operand position into account. The new tests
exhaustively cover all operand positions for `ule`, `uge`, `ult`,
`ugt` (the set of predicates) and all transform verify with the new
commit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156058

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/ispow2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156058.543293.patch
Type: text/x-patch
Size: 6628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230723/cbe7213a/attachment.bin>


More information about the llvm-commits mailing list