The patch in D155211 added basic support for the .alias keyword in
PTX. This means we should be able to permit use of this in clang.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
1995 | Allowing or not noreturn depends on the CUDA version we're building with (or rather on the PTX version we need for .noreturn instruction). We would still need to issue the diagnostics if we're using CUDA older than 10.1. |
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
1995 | Make it .alias and CUDA older than 10.0. |
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
1995 | Do we do any similar diagnostics checks on the CUDA version? I thought that was more of a clang driver thing and we'd just let the backend handle the failure, since we can emit LLVM-IR that can be compiled irrespective of the CUDA version used to make it. |
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
1995 | I checked and I don't think we pass in any CUDA version information to the -cc1 compiler. In this case if the user didn't have sufficient utilities it would simply fail in the backend or in PTX. We have semi-helpful messages there and it would be a good indicator to update CUDA. Is this fine given that? |
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
1995 | We do pass it via -target-sdk-version=... https://github.com/llvm/llvm-project/blob/1b74459df8a6d960f7387f0c8379047e42811f58/clang/lib/Driver/ToolChains/Clang.cpp#L4707 And then check with getSDKVersion. E.g. https://github.com/llvm/llvm-project/blob/1b74459df8a6d960f7387f0c8379047e42811f58/clang/lib/CodeGen/CGCUDANV.cpp#L317 |
Update to check the SDK version. Permit this if there is not passed in SDK version so that freestanding targets can still target CUDA and assume it's supported.
9e99a4f0db0e21b68e9aab9ad6f32f34d42eb460 ? That is not yet built but looks promising. Thanks.
Allowing or not noreturn depends on the CUDA version we're building with (or rather on the PTX version we need for .noreturn instruction).
We would still need to issue the diagnostics if we're using CUDA older than 10.1.