[SYCL][CUDA][libclc] Clone functions rather than aliasing in remangler#5921
[SYCL][CUDA][libclc] Clone functions rather than aliasing in remangler#5921bader merged 3 commits intointel:syclfrom
Conversation
|
Is it possible to add a LIT test for libclc-remangler? |
Yes, good idea. I'll start working on this, but perhaps it ought to be a separate PR? |
I'm ok with adding a LIT test in a separate patch. Thank you. |
This works, I think, but we hit a new error relating to lack of DCE after NVVM Reflect
|
@bader ping - I rebased to retrigger broken CI but it dismissed approvals |
Please, use GitHub UI to re-request review, otherwise, it's hard to find PRs where inputs are needed. |
Apologies - I will do this in future 👍 |
The libclc remangler handles function overloads with e.g.
long longlongandint, ensuring consistency with OpenCL C primitives. Previously, this was achieved by creating aGlobalAliasfor each of the various overloads. However, the NVPTX target does not work with function aliases. Normally, an optimization pass removes these aliases, but the present approach prevents compiling with DPC++ for CUDA with-O0.This PR changes the behaviour of the remangler to emit function clones (a copy of the function with a different name). There is a risk that this bloats the compiled code, but optimization should remove unneeded clones, as it did with unneeded aliases.
There is an additional barrier to
-O0compilation for NVPTX relating tonvvm_reflect, addressed here: #5900Note: this PR is best reviewed as separate commits. The first commit makes the (small) functional change. The second commit is simply renaming all 'Alias*' variables to 'Clone*'.