[DAGCombiner][AMDGPU] Canonicalize constants to the RHS of MULHU/MULHS.
authorCraig Topper <craig.topper@sifive.com>
Wed, 4 Aug 2021 18:39:21 +0000 (11:39 -0700)
committerCraig Topper <craig.topper@sifive.com>
Wed, 4 Aug 2021 18:39:23 +0000 (11:39 -0700)
commitc23405174a3f26c044498af411e139e5f104f998
treea08171842ddd98af6dbdefe71384e8b7ef683d06
parent2dad7979909a02d480514f37c9e55f752c0aa0a5
[DAGCombiner][AMDGPU] Canonicalize constants to the RHS of MULHU/MULHS.

This allows special constants like to 0 to be recognized. It's also
expected by isel patterns if a target had a mulh with immediate instructions.
The commuting done by tablegen won't commute patterns with immediates since it
expects DAGCombine to have done it.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D107486
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-idiv.ll
llvm/test/CodeGen/AMDGPU/sdiv64.ll
llvm/test/CodeGen/AMDGPU/srem64.ll
llvm/test/CodeGen/AMDGPU/udiv64.ll