[PATCH] D48662: [InstCombine] reverse canonicalization of binops to allow more shuffle folding

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 10:42:35 PDT 2018


spatel created this revision.
spatel added reviewers: RKSimon, lebedev.ri, efriedma.
Herald added a subscriber: mcrosier.

This is a superset of https://reviews.llvm.org/D48485 that includes transforming an 'or' back into an 'add' in addition to the shl+mul case shown there.

Here, we need value tracking to determine that the 'or' can be reversed into an 'add'.

IIUC, there are only a handful of opcodes where we'll try this. To repeat from the other review - I think we're distinguishing this pattern from the scenario where we have eliminated a binop completely and need to materialize a 'ghost' op with an identity constant.


https://reviews.llvm.org/D48662

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48662.153122.patch
Type: text/x-patch
Size: 8154 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180627/a26ee79e/attachment.bin>


More information about the llvm-commits mailing list