[PATCH] D132658: [InstCombine] Distributive or+mul with const operand

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 07:08:45 PDT 2022


Allen created this revision.
Allen added reviewers: spatel, bcl5980, RKSimon, nikic, efriedma.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Allen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We aleady support the transform: (X+C1 <https://reviews.llvm.org/C1>)*CI -> X*CI+C1 <https://reviews.llvm.org/C1>*CI
Here the case is a little special as the form of (X+C1 <https://reviews.llvm.org/C1>)*CI is transformed into (X|C1 <https://reviews.llvm.org/C1>)*CI,
so we should also support the transform: (X|C1 <https://reviews.llvm.org/C1>)*CI -> X*CI+C1 <https://reviews.llvm.org/C1>*CI
Fixes https://github.com/llvm/llvm-project/issues/57278


https://reviews.llvm.org/D132658

Files:
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/test/Transforms/InstCombine/distributive_const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132658.455575.patch
Type: text/x-patch
Size: 13731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220825/2cd07a7e/attachment.bin>


More information about the llvm-commits mailing list