[InstCombine] canonicalize rotate right by constant to rotate left
authorSanjay Patel <spatel@rotateright.com>
Sun, 17 Mar 2019 19:08:00 +0000 (19:08 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 17 Mar 2019 19:08:00 +0000 (19:08 +0000)
commitb3bcd95771810f75736c1be0088618a03c9f0fe3
tree21063a0040e6b0b5e5bfe4d9025d39933038093f
parenta3a2f9424e0c45e0fefa1c81bd370bfa8d8ac1e2
[InstCombine] canonicalize rotate right by constant to rotate left

This was noted as a backend problem:
https://bugs.llvm.org/show_bug.cgi?id=41057
...and subsequently fixed for x86:
rL356121
But we should canonicalize these in IR for the benefit of all targets
and improve IR analysis such as CSE.

llvm-svn: 356338
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/fsh.ll