HomePhabricator

[DAGCombiner] rot i16 X, 8 --> bswap X

Authored by spatel on Jul 13 2020, 8:35 AM.

Description

[DAGCombiner] rot i16 X, 8 --> bswap X

We have this generic transform in IR (instcombine),
but as shown in PR41098:
http://bugs.llvm.org/PR41098
...the pattern may emerge in codegen too.

x86 has a potential refinement/reversal opportunity here,
but that should come later or needs a target hook to
avoid the transform. Converting to bswap is the more
specific form, so we should use it if it is available.

Details

Committed
spatelJul 13 2020, 9:01 AM
Parents
rG69fff1fc498f: [x86] add tests for bswap/rotate; NFC
Branches
Unknown
Tags
Unknown