llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL][Driver] Pass -emit-param-info (almost) unconditionally

Open AlexeySachkov opened this issue 3 years ago • 4 comments

Motivation behind this change is that user can set different optimization levels at compil and link stages when separate compilation is performed:

clang++ -fsycl -c a.cpp -O2 -o a.o
clang++ -fsycl a.o -O0 -o a.out

In such situation, compile step launches dead argument eliminination optimization, which could alter kernels signature. However, during the link step -emit-param-info weren't passed until this commit and without that information runtime is not capable to handle altered kernel signature (with arguments being optimized out).

AlexeySachkov avatar Mar 30 '22 11:03 AlexeySachkov

/summary:run

AlexeySachkov avatar Mar 31 '22 09:03 AlexeySachkov

/verify with intel/llvm-test-suite#970

AlexeySachkov avatar Apr 04 '22 08:04 AlexeySachkov

Do I understand correctly this won't impact the scenario with the "full" -O0 compilation due to no DAE metadata being provided by the "early optimization" part of the pipeline?

@AGindinson, that is correct, sycl-post-link is capable of skipping kernels without metadata, thus emitting no DAE device image properties for them:

https://github.com/intel/llvm/blob/cb4e702870604f9360c4d042b197ba379a3a8d4c/llvm/tools/sycl-post-link/SYCLKernelParamOptInfo.cpp#L29-L32

AlexeySachkov avatar Apr 04 '22 09:04 AlexeySachkov

/verify with intel/llvm-test-suite#970

AlexeySachkov avatar Aug 10 '22 13:08 AlexeySachkov

CUDA LLVM test suite failure doesn't seem to be caused by this patch and it was already recorded in #6463

AlexeySachkov avatar Aug 11 '22 09:08 AlexeySachkov

@intel/dpcpp-clang-driver-reviewers, could you please take a look at this PR?

AlexeySachkov avatar Aug 12 '22 12:08 AlexeySachkov