[DAGCombiner] Teach combineShiftToMULH to handle constant and const splat vector.
authorjacquesguan <jacquesguan@me.com>
Tue, 2 Nov 2021 11:13:04 +0000 (11:13 +0000)
committerBen Shi <powerman1st@163.com>
Tue, 2 Nov 2021 12:04:23 +0000 (12:04 +0000)
commita39eadcf1609db66a42fa00d55da6e1ff734e1b3
tree84d5572fe1f34079b4c6d151a945517e746c35a0
parent4ec1b8eeac442a44cad329bd28d5c229c227b1f7
[DAGCombiner] Teach combineShiftToMULH to handle constant and const splat vector.

Fold (srl (mul (zext i32:$a to i64), i64:c), 32) -> (mulhu $a, $b),
if c can truncate to i32 without loss.

Reviewed By: frasercrmck, craig.topper, RKSimon

Differential Revision: https://reviews.llvm.org/D108129
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/RISCV/rvv/vmulh-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vmulhu-sdnode.ll