]> granicus.if.org Git - llvm/commit
[InstCombine] reduce funnel-shift i16 X, X, 8 to bswap X
authorSanjay Patel <spatel@rotateright.com>
Mon, 24 Jun 2019 15:20:49 +0000 (15:20 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 24 Jun 2019 15:20:49 +0000 (15:20 +0000)
commit0eaa3a2c7c3141022e44e83463d1f8bef4175f58
treef54396cbdcc0ff1d17c84948c2123d7eed417b7e
parentea7a0ec9172ebbce755e9ba757dc861db4b9be57
[InstCombine] reduce funnel-shift i16 X, X, 8 to bswap X

Prefer the more exact intrinsic to remove a use of the input value
and possibly make further transforms easier (we will still need
to match patterns with funnel-shift of wider types as pieces of
bswap, especially if we want to canonicalize to funnel-shift with
constant shift amount). Discussed in D46760.

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