This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Start matching s_lshlN_add_u32 instructions
ClosedPublic

Authored by arsenm on Feb 20 2020, 6:00 PM.

Details

Summary

Use a hack to only enable this for GlobalISel.

Technically this also works with SelectionDAG, but the divergence
selection isn't reliable enough and a few cases fail, but I have no
desire to spend time writing the manual expansion code for it. The DAG
actually does a better job since it catches using v_add_lshl_u32 in
the mixed SGPR/VGPR cases.

Diff Detail

Event Timeline

arsenm created this revision.Feb 20 2020, 6:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2020, 6:00 PM
arsenm marked an inline comment as done.Feb 20 2020, 6:47 PM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/SIInstrInfo.td
636

I just realized this needs a hasOneUse check

arsenm updated this revision to Diff 245877.Feb 21 2020, 8:36 AM

Check hasOneUse

foad accepted this revision.Mar 9 2020, 4:58 AM

LGTM. It seems to work OK on graphics shaders, though it hardly ever kicks in.

This revision is now accepted and ready to land.Mar 9 2020, 4:58 AM