[DAGCombiner] Bug 31275- Extract a shift from a constant mul or udiv if a rotate...
authorDavid Bolvansky <david.bolvansky@gmail.com>
Mon, 30 Jul 2018 16:50:00 +0000 (16:50 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Mon, 30 Jul 2018 16:50:00 +0000 (16:50 +0000)
commit2fa7fb14ea5d7009470079640381e23e88c61f1b
tree24f9a4076bb5ca910a37c9d6c058f701e99235b8
parent196149c943ffde9f2f3368fc47d5f843a9ab44a4
[DAGCombiner] Bug 31275- Extract a shift from a constant mul or udiv if a rotate can be formed

Summary:
Attempt to extract a shrl from a udiv or a shl from a mul if this allows a rotate to be formed.  This targets cases where the input to a rotate pattern was a mul or udiv by a constant and InstCombine merged one of the shifts with the op.

Patch by: sameconrad (Sam Conrad)

Reviewers: RKSimon, craig.topper, spatel, lebedev.ri, javed.absar

Reviewed By: lebedev.ri

Subscribers: efriedma, kparzysz, llvm-commits

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

llvm-svn: 338270
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/rotate-extract.ll
llvm/test/CodeGen/X86/rotate-extract-vector.ll
llvm/test/CodeGen/X86/rotate-extract.ll