[PATCH] D122390: [InstCombine] merge shuffled vector negate and multiply

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 05:46:16 PDT 2022


spatel created this revision.
spatel added reviewers: lebedev.ri, RKSimon.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: All.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add the "(0 - X) --> X * -1" reverse identity to the list of alternate form binops.

We need a little hack to make the existing logic work because it does not expect to move constants from op0 to op1, but the code comment hopefully makes that clear. I don't think there are any other identities like that.

Fixes #54364 ( https://github.com/llvm/llvm-project/issues/54364 ).


https://reviews.llvm.org/D122390

Files:
  llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
  llvm/test/Transforms/InstCombine/shuffle_select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122390.417894.patch
Type: text/x-patch
Size: 5089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220324/6b4f9133/attachment.bin>


More information about the llvm-commits mailing list