This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner][AMDGPU] Canonicalize constants to the RHS of MULHU/MULHS.
ClosedPublic

Authored by craig.topper on Aug 4 2021, 10:54 AM.

Details

Summary

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.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 4 2021, 10:54 AM
craig.topper requested review of this revision.Aug 4 2021, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 10:54 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad accepted this revision.Aug 4 2021, 11:30 AM

LGTM, thanks!

llvm/test/CodeGen/AMDGPU/sdiv64.ll
1211

Looks like there is some further cleanup possible here. This instruction is "add 0 with carry out" which is pretty useless.

This revision is now accepted and ready to land.Aug 4 2021, 11:30 AM