Skip to content

PR for llvm/llvm-project#57544 #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2023
Merged

PR for llvm/llvm-project#57544 #698

merged 1 commit into from
Sep 29, 2023

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Sep 12, 2023

Fixes llvm/llvm-project#57544

(cherry picked from commit 588023ddafb4b0cd11914ab068c6d07187374d69)
@tru
Copy link
Contributor

tru commented Sep 28, 2023

@yxsamliu should this be backported to 17.x?

@tru
Copy link
Contributor

tru commented Sep 28, 2023

cc @AaronBallman @cor3ntin @erichkeane since it touches clang

Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this the correct fix instead of messing with __noinline__? We already document __noinline__ as a CUDA keyword intended to avoid diagnostics with __attribute__((__noinline__)), so this change seems questionable on its face.

@yxsamliu
Copy link
Contributor

Why is this the correct fix instead of messing with __noinline__? We already document __noinline__ as a CUDA keyword intended to avoid diagnostics with __attribute__((__noinline__)), so this change seems questionable on its face.

I think this is to workaround nvcc header which defines __noinline__ in a way that clang cannot handle.

@Artem-B

@AaronBallman
Copy link
Contributor

Why is this the correct fix instead of messing with __noinline__? We already document __noinline__ as a CUDA keyword intended to avoid diagnostics with __attribute__((__noinline__)), so this change seems questionable on its face.

I think this is to workaround nvcc header which defines __noinline__ in a way that clang cannot handle.

@Artem-B

As best I could tell from the original patch discussion, I think that's correct, but it seems this has been a long-standing NVCC bug that should be resolved in their headers rather than expecting compilers to work around it, yes? CC @erichkeane since this is attributes related.

@erichkeane
Copy link

I don't have a good solution here, it seems that this is the NVCC headers leaking the definition unfortunately, and I've reached out to the CUDA team at NVIDIA to see if this is something that could be fixed in the future. However, that obviously doesn't fix the past, so I suspect we'll have to put this in anyway.

@AaronBallman
Copy link
Contributor

I don't have a good solution here, it seems that this is the NVCC headers leaking the definition unfortunately, and I've reached out to the CUDA team at NVIDIA to see if this is something that could be fixed in the future. However, that obviously doesn't fix the past, so I suspect we'll have to put this in anyway.

Thanks for reaching out! And yeah, you're right, I think we're going to need this regardless.

Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yxsamliu
Copy link
Contributor

@yxsamliu should this be backported to 17.x?

LGTM

@Artem-B
Copy link
Member

Artem-B commented Sep 28, 2023

I think we're going to need this regardless.

That's, unfortunately, true.

Fun tidbit. NVCC itself does run into this problem and apparently deals with this by un-doing this mess. When it sees __attribute__((__attribute__(("noinline")))) it transforms it back to __attribute__(("noinline")).

@Artem-B
Copy link
Member

Artem-B commented Sep 29, 2023

For the reference: NVIDIA/thrust#1703 (comment)

@tru tru merged commit 87ec1f4 into release/17.x Sep 29, 2023
@tru tru deleted the llvm-issue57544 branch September 29, 2023 06:23
enm10k added a commit to shiguredo/sora-cpp-sdk that referenced this pull request Jan 17, 2024
enm10k added a commit to shiguredo/sora-cpp-sdk that referenced this pull request Jan 19, 2024
enm10k added a commit to shiguredo/sora-cpp-sdk that referenced this pull request Jan 24, 2024
enm10k added a commit to shiguredo/sora-cpp-sdk that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With gcc-12's libstdc++, clang-15 rc2 still cannot compile CUDA/HIP code because of __noinline__
6 participants