This is an archive of the discontinued LLVM Phabricator instance.

[CUDA][HIP] Set kernel calling convention before arrange function
ClosedPublic

Authored by yaxunl on Jun 4 2018, 11:23 AM.

Details

Summary

Currently clang set kernel calling convention for CUDA/HIP after
arranging function, which causes incorrect kernel function type since
it depends on calling convention.

This patch moves setting kernel convention before arranging
function.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl created this revision.Jun 4 2018, 11:23 AM
tra added a comment.Jun 5 2018, 2:28 PM

Looks OK overall, but I'm not very familiar with CGCall, so you may want to dig through the history and find someone with more expertise.

test/CodeGenCUDA/kernel-args-amdgcn.cu
1 ↗(On Diff #149811)

Please add some checks that verify that CUDA kernels still don't have any extra calling conventions set.

yaxunl updated this revision to Diff 150106.Jun 6 2018, 4:22 AM

Revised by Artem's comments.

tra added a reviewer: rsmith.Jun 6 2018, 10:05 AM

@rsmith - Richard, can you take a look?

test/CodeGenCUDA/kernel-args.cu
1–2 ↗(On Diff #150106)

Please wrap the long RUN lines.

yaxunl updated this revision to Diff 150559.Jun 8 2018, 1:28 PM
yaxunl marked an inline comment as done.

Wrap long RUN lines in test.

This revision is now accepted and ready to land.Jun 11 2018, 11:56 AM
This revision was automatically updated to reflect the committed changes.