[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-04-10 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 141932. tra added a comment. @echristo convinced me that this functionality can be implemented without growing a target-specific hook for custom interpretation of constraints used in TARGET_BUILTIN. Instead, we can hide unwieldy feature lists behind a macro.

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-04-03 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D45061#1053795, @echristo wrote: > Let's talk about the rest of it more. I'm not sure I'm seeing the need here > rather than the annotations that are already here. Can you elaborate more > here on why we need an additional method when you've

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-31 Thread Eric Christopher via Phabricator via cfe-commits
echristo added a comment. The llvm change and corresponding switch from satom->sm_60 in the front end is fine. Let's talk about the rest of it more. I'm not sure I'm seeing the need here rather than the annotations that are already here. Can you elaborate more here on why we need an

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-30 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 140493. tra added a comment. Commented out unused argument. https://reviews.llvm.org/D45061 Files: clang/include/clang/Basic/BuiltinsNVPTX.def clang/lib/Basic/Targets/NVPTX.cpp clang/lib/Basic/Targets/NVPTX.h clang/test/CodeGen/builtins-nvptx-ptx50.cu

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-30 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 140447. tra added a comment. Removed unneeded function. https://reviews.llvm.org/D45061 Files: clang/include/clang/Basic/BuiltinsNVPTX.def clang/lib/Basic/Targets/NVPTX.cpp clang/lib/Basic/Targets/NVPTX.h clang/test/CodeGen/builtins-nvptx-ptx50.cu

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-30 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/include/clang/Basic/Cuda.h:55 +static inline const std::vector CudaKnownArchList() { + return {CudaArch::SM_20, CudaArch::SM_21, CudaArch::SM_30, CudaArch::SM_32, jlebar wrote: > Why 'static'? Old habits. Just

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-29 Thread Justin Lebar via Phabricator via cfe-commits
jlebar accepted this revision. jlebar added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Basic/Cuda.h:55 +static inline const std::vector CudaKnownArchList() { + return {CudaArch::SM_20, CudaArch::SM_21, CudaArch::SM_30,

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-29 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 140334. tra added a comment. Run the tests with -target-cpu sm_61 to make sure intrinsics that require sm_60 are still enabled. https://reviews.llvm.org/D45061 Files: clang/include/clang/Basic/BuiltinsNVPTX.def clang/include/clang/Basic/Cuda.h

[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.

2018-03-29 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision. tra added a reviewer: jlebar. Herald added subscribers: hiraditya, sanjoy, jholewinski. When NVPTX TARGET_BUILTIN specifies sm_XX or ptxYY as required feature, consider those features available if we're compiling for GPU >= sm_XX or have enabled PTX version >= ptxYY.