[DAGCombine] Do not fold SRA/SRL of MUL into MULH when MUL's LSB are
authorJuan Manuel MARTINEZ CAAMAÑO <juamarti@amd.com>
Fri, 16 Sep 2022 09:40:33 +0000 (09:40 +0000)
committerJuan Manuel MARTINEZ CAAMAÑO <juamarti@amd.com>
Fri, 16 Sep 2022 15:48:36 +0000 (15:48 +0000)
commite438f2d821119439c2b05b2fef7617064a6233bc
tree00c53b19fdfa11d5ba7c8b8b6cbf056dc9a51bc6
parentf4ea3bd4b2086e6de10131b197aaf7d066a24df8
[DAGCombine] Do not fold SRA/SRL of MUL into MULH when MUL's LSB are
used, and MUL_LOHI is available

Folding into a sra(mul) / srl(mul) into a mulh introduces an extra
multiplication to compute the high half of the multiplication,
while it is more profitable to compute the high and lower halfs with a
single mul_lohi.

Differential Revision: https://reviews.llvm.org/D133768
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/dagcomb-mullohi.ll [new file with mode: 0644]