This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add .uniform_work_group_size metadata to v5
ClosedPublic

Authored by vangthao on Jan 4 2023, 1:22 PM.

Details

Summary

Amdgpu kernel with function attribute "uniform-work-group-size"="true" requires
uniform work group size (i.e. each dimension of global size is a multiple of
corresponding dimension of work group size). hipExtModuleLaunchKernel allows to
launch HIP kernel with non-uniform workgroup size, which makes it necessary for
runtime to check and enforce uniform workgroup size if kernel requires it. To
let runtime be able to enforce that, this metadata is needed to indicate that
the kernel requires uniform workgroup size.

Diff Detail

Unit TestsFailed

Event Timeline

vangthao created this revision.Jan 4 2023, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 1:22 PM
vangthao requested review of this revision.Jan 4 2023, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 1:22 PM
arsenm added inline comments.Jan 4 2023, 1:41 PM
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
1087–1090

Don't need to query it twice, just use getFnAttribute once.

I thought there was a helper around for these awful bool string attributes

vangthao updated this revision to Diff 486392.Jan 4 2023, 2:14 PM

Query function attribute once and use getValueAsBool helper function

arsenm accepted this revision.Jan 4 2023, 2:41 PM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/hsa-metadata-uniform-workgroup-size-v5.ll
2

Don't need -verify-machineinstrs

This revision is now accepted and ready to land.Jan 4 2023, 2:41 PM
vangthao updated this revision to Diff 486433.Jan 4 2023, 4:50 PM

Remove -verify-machineinstrs from test

arsenm accepted this revision.Jan 4 2023, 5:01 PM
This revision was landed with ongoing or failed builds.Jan 5 2023, 1:31 PM
This revision was automatically updated to reflect the committed changes.