This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix lowering enqueue kernel when kernel has no name
ClosedPublic

Authored by yaxunl on Mar 9 2018, 12:36 PM.

Details

Summary

Since the enqueued kernels have internal linkage, their names may be dropped.
In this case, give them unique names __amdgpu_enqueued_kernel or
__amdgpu_enqueued_kernel.n where n is a sequential number starting from 1.

Diff Detail

Event Timeline

yaxunl created this revision.Mar 9 2018, 12:36 PM
rampitec accepted this revision.Mar 9 2018, 1:12 PM

LGTM

This revision is now accepted and ready to land.Mar 9 2018, 1:12 PM
arsenm added inline comments.Mar 9 2018, 1:46 PM
lib/Target/AMDGPU/AMDGPUOpenCLEnqueuedBlockLowering.cpp
99

Should this use getNameWithPrefix instead?

yaxunl marked an inline comment as done.Mar 9 2018, 2:18 PM
yaxunl added inline comments.
lib/Target/AMDGPU/AMDGPUOpenCLEnqueuedBlockLowering.cpp
99

Yes. It is better to use the standard way. Will do.

yaxunl updated this revision to Diff 137841.Mar 9 2018, 2:23 PM
yaxunl marked an inline comment as done.
yaxunl edited the summary of this revision. (Show Details)

Use getNameWithPrefix.

This revision was automatically updated to reflect the committed changes.