OSDN Git Service

[InstCombine] reverse canonicalization of add --> or to allow more shuffle folding
authorSanjay Patel <spatel@rotateright.com>
Mon, 2 Jul 2018 17:42:29 +0000 (17:42 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 2 Jul 2018 17:42:29 +0000 (17:42 +0000)
commitc9a157f7fd56e33fe53b20f6a2728ff7e01576bf
tree082b19c485ffcffa20433a06e58646231b35d3cf
parenta5d70d8749bd7132d4b2f805f4ca85bafd6edb07
[InstCombine] reverse canonicalization of add --> or to allow more shuffle folding

This extends D48485 to allow another pair of binops (add/or) to be combined either
with or without a leading shuffle:
or X, C --> add X, C (when X and C have no common bits set)

Here, we need value tracking to determine that the 'or' can be reversed into an 'add',
and we've added general infrastructure to allow extending to other opcodes or moving
to where other passes could use that functionality.

Differential Revision: https://reviews.llvm.org/D48662

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336128 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineVectorOps.cpp
test/Transforms/InstCombine/shuffle_select.ll