This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] gfx11 Generate VOPD Instructions
ClosedPublic

Authored by Joe_Nash on Jun 27 2022, 8:38 AM.

Details

Summary

We form VOPD instructions in the GCNCreateVOPD pass by combining
back-to-back component instructions. There are strict register
constraints for creating a legal VOPD, namely that the matching operands
(e.g. src0x and src0y, src1x and src1y) must be in different register
banks. We add a PostRA scheduler
mutation to put possible VOPD components back-to-back.

Depends on D128442, D128270

Diff Detail

Event Timeline

Joe_Nash created this revision.Jun 27 2022, 8:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 8:38 AM
Joe_Nash requested review of this revision.Jun 27 2022, 8:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 8:38 AM

There may be some strange looking test changes related to s_delay_alu or s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) because I intend to rebase it on D128270 and D128442. Please ignore those for the moment.

Joe_Nash added reviewers: Restricted Project, foad, rampitec, arsenm, critson, fhahn.Jun 27 2022, 8:46 AM
arsenm added inline comments.Jun 27 2022, 9:41 AM
llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp
117

You can << *Pair.first

llvm/lib/Target/AMDGPU/GCNVOPDUtils.cpp
140

Ditto

arsenm added inline comments.Jun 27 2022, 9:46 AM
llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp
150

Weird auto

Joe_Nash updated this revision to Diff 440409.Jun 27 2022, 3:07 PM
Joe_Nash marked 3 inline comments as done.

changed auto to explicit type, changed print syntax in dbg statement, fixed bad DBG_VALUE in test

rampitec added inline comments.Jun 30 2022, 1:58 PM
llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp
86

Could merge this case with the previous.

104

Here as well.

llvm/lib/Target/AMDGPU/GCNVOPDUtils.cpp
173

Isn't it the same as MacroFusion?

Joe_Nash updated this revision to Diff 441521.Jun 30 2022, 2:21 PM
Joe_Nash marked 2 inline comments as done.

combine cases in doReplace

llvm/lib/Target/AMDGPU/GCNVOPDUtils.cpp
173

No. Macrofusion only pairs instructions which are already data dependent (see MacroFusion.cpp:176), while this mutator considers all pairs of instructions.

This revision is now accepted and ready to land.Jun 30 2022, 2:24 PM
This revision was landed with ongoing or failed builds.Jul 5 2022, 6:48 AM
This revision was automatically updated to reflect the committed changes.