[TargetLowering] Improve expansion of ROTL/ROTR
authorJay Foad <jay.foad@amd.com>
Fri, 3 Apr 2020 13:11:56 +0000 (14:11 +0100)
committerJay Foad <jay.foad@amd.com>
Mon, 6 Jul 2020 11:07:14 +0000 (12:07 +0100)
commite7a4a24dc50ab115cd0838bbf47d61251530a0cd
treee0acc076f7c0bca3ca0c45191edcd8abc708537f
parent690ff37a286991f142584f25842e50c6cb23aba6
[TargetLowering] Improve expansion of ROTL/ROTR

Using a negation instead of a subtraction from a constant can save an
instruction on some targets.

Nothing much uses this until D77152 changes the translation of fshl and
fshr intrinsics.

Differential Revision: https://reviews.llvm.org/D82539
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp