This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add `.workgroup_processor_mode` to v5 MD
ClosedPublic

Authored by Pierre-vh on Dec 13 2022, 5:57 AM.

Details

Summary

Adds Workgroup Processor Mode (WGP) to the HSA Metadata for Code Object v5/GFX10+.
The field is already present as an asm directive and in the compute program resource register but is also needed in the MD.

Diff Detail

Event Timeline

Pierre-vh created this revision.Dec 13 2022, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2022, 5:57 AM
Pierre-vh requested review of this revision.Dec 13 2022, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2022, 5:57 AM
foad added a comment.Dec 13 2022, 6:10 AM

Adds Workgroup Processor Mode (WGM)

Is that a typo for "WGP"?

Pierre-vh planned changes to this revision.Dec 13 2022, 6:12 AM

Adds Workgroup Processor Mode (WGM)

Is that a typo for "WGP"?

Indeed
(note the patch is still a WIP - tests are lacking,I should have included it in the title)

Pierre-vh retitled this revision from [AMDGPU] Add `.workgroup_processor_mode` to v5 MD to (WIP) [AMDGPU] Add `.workgroup_processor_mode` to v5 MD.Dec 13 2022, 6:13 AM
Pierre-vh edited the summary of this revision. (Show Details)

Also needs a test.

llvm/include/llvm/Support/AMDHSAKernelDescriptor.h
165–166 ↗(On Diff #482445)

These changes are not needed. WGP_MODE is recorded in COMPUTE_PGM_RSRC1.

llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
417–419 ↗(On Diff #482445)

These changes are not needed.

arsenm added inline comments.Dec 13 2022, 6:39 AM
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
881

Can you hide this generation check in a supportsWGP predicate in the subtarget

Pierre-vh updated this revision to Diff 482468.Dec 13 2022, 7:20 AM

Address comments, add test

Pierre-vh retitled this revision from (WIP) [AMDGPU] Add `.workgroup_processor_mode` to v5 MD to [AMDGPU] Add `.workgroup_processor_mode` to v5 MD.Dec 13 2022, 7:21 AM
kzhuravl added inline comments.Dec 13 2022, 7:24 AM
llvm/test/CodeGen/AMDGPU/hsa-metadata-workgroup-processor-mode-v5.ll
7–8

Can you also add checks for amdhsa_workgroup_processor_mode ASM directive?

Pierre-vh updated this revision to Diff 482480.Dec 13 2022, 7:39 AM
Pierre-vh marked an inline comment as done.

Add extra test check

kzhuravl accepted this revision.Dec 13 2022, 7:42 AM

lgtm, thanks

This revision is now accepted and ready to land.Dec 13 2022, 7:42 AM
This revision was landed with ongoing or failed builds.Dec 13 2022, 7:44 AM
This revision was automatically updated to reflect the committed changes.