[PATCH] D140850: [Patch 2/4]: Add optimizations for icmp eq/ne (mul(X, Y), 0)

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 11:21:34 PST 2023


goldstein.w.n created this revision.
Herald added a subscriber: 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.

1. Add checks if X and/or Y are odd. The Odd values are unnecessary to the icmp: isZero(Odd * N) == isZero(N)

2. If neither X nor Y is known odd, then if X * Y cannot overflow AND if X and/or Y is non-zero, the non-zero values are unnecessary to the icmp.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140850

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/icmp-binop.ll
  llvm/test/Transforms/InstCombine/pr38677.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140850.485875.patch
Type: text/x-patch
Size: 7130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230102/c769093b/attachment.bin>


More information about the llvm-commits mailing list