This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Add llvm.amdgcn.dispatch.ptr intrinsic
ClosedPublic

Authored by tstellarAMD on Nov 20 2015, 5:40 PM.

Details

Summary

This returns a pointer to the dispatch packet, which can be used to load
information about the kernel dispach.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU: Add llvm.amdgcn.dispatch.ptr intrinsic.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm added inline comments.Nov 25 2015, 8:02 AM
include/llvm/IR/IntrinsicsAMDGPU.td
131 ↗(On Diff #40855)

Typo: disaptch

132 ↗(On Diff #40855)

Is there a way to mark noalias on the return value?

lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
106–109 ↗(On Diff #40855)

Later this should probably be cleaned up to only check the dispatch.ptr one for HSA, and the read.global.size.x should not set this

Added test case, fixed typo.

include/llvm/IR/IntrinsicsAMDGPU.td
132 ↗(On Diff #40855)

I added noalias to the declaration and call in the test case and it still selects correctly. I'll look into this more when adding the clang patch for the builtin.

arsenm accepted this revision.Nov 25 2015, 9:06 AM
arsenm edited edge metadata.

LGTM. The intrinsic should probably have a comment that it is only for when targeting HSA

This revision is now accepted and ready to land.Nov 25 2015, 9:06 AM
This revision was automatically updated to reflect the committed changes.