This avoid CUDA compilation errors caused by CUDA headers defining noinline
and conflicting with noinline use in libstdc++.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Fun tidbit: https://github.com/NVIDIA/thrust/issues/1703#issuecomment-1526604000
Indeed, I believe the nvcc frontend has special handling for that attribute expansion. clang would need to emulate that "special" handling
Right. The attribute((attribute((noinline)))) void foo(); gets magically transformed into __attribute((noinline)) void foo() by the time it makes it to the final host compilation. 😭
And the magic seems to work only for attribute((attribute((noinline)))). Any other variants I tried error out.
So, it's been a known issue in the CUDA headers, deliberately worked around in NVCC. And now the bug lives on and keeps giving...
LGTM.
This issue does not affect HIP as HIP headers have removed __noinline__ as a macro since https://reviews.llvm.org/D124866 and __attribute__((__noinline__)) is equivalent to __attribute__((noinline)) for HIP.