[PATCH] D127267: [NVPTX] Add setAuxTarget override rather than make a new TargetInfo
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 9 14:55:30 PDT 2022
tra added a comment.
I think the root cause of the problem here is that CUDA compilation assumes that the GPU-side looks identical to the host side of the compilation. The test was intended to verify that and, AFAICT, it did its job flagging the issue here.
AFAICT, __GCC_ATOMIC_LLONG_LOCK_FREE=1 is the correct setting for the GPU.
In this particular case host and GPU do have different capabilities and the compiler will see a different subset of preprocessed sources, that's unfortunate, but unavoidable, unless we force the host to have value of 1.
Setting _GCC_ATOMIC_LLONG_LOCK_FREE=2 on the GPU side would result in an invalid code and we definitely do not want to do that.
I think the right thing to do here is to add `__GCC_ATOMIC_LLONG_LOCK_FREE=` to the list of ignored differences in the clang/test/Preprocessor/cuda-types.cu, similar to how we handle `LONG_DOUBLE`-related macros there.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127267/new/
https://reviews.llvm.org/D127267
More information about the cfe-commits
mailing list