This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add attribute to AMDGPU ctor / dtor to indicate single threadedness
ClosedPublic

Authored by jhuber6 on May 22 2023, 1:52 PM.

Details

Summary

We only expect these ctor / dtor functions to be called with a single
thread. Add the appropriate attributes to indicate this to the backend.

Diff Detail

Unit TestsFailed

Event Timeline

jhuber6 created this revision.May 22 2023, 1:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 1:52 PM
jhuber6 requested review of this revision.May 22 2023, 1:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 1:52 PM

Can you check the device metadata for these in the codegen output

jhuber6 updated this revision to Diff 524481.May 22 2023, 1:59 PM

Adding check on the elf notes

arsenm accepted this revision.May 22 2023, 2:19 PM

Should probably document this in AMDGPUUsage. Is this really true for the asan usage?

This revision is now accepted and ready to land.May 22 2023, 2:19 PM

@ampandey-AMD
Is it true that asan and others only runs these with a single thread?

This revision was landed with ongoing or failed builds.May 24 2023, 5:24 AM
This revision was automatically updated to reflect the committed changes.
arsenm added inline comments.May 24 2023, 8:10 AM
llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
41

We should probably teach UniformityAnalysis about this special case for the work item IDs

jhuber6 added inline comments.May 24 2023, 8:12 AM
llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
41

This special case where the number of threads is one? It would definitely simplify anything to do with convergence.