llvm-project/clang/test
Samuel Antao d06239d359 [CUDA][OpenMP] Create generic offload action
Summary:
This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs.

This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture.

This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures)
```
0: input, "cudatests.cu", cuda, (host-cuda)
1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
2: compiler, {1}, ir, (host-cuda)
3: input, "cudatests.cu", cuda, (device-cuda, sm_35)
4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35)
5: compiler, {4}, ir, (device-cuda, sm_35)
6: backend, {5}, assembler, (device-cuda, sm_35)
7: assembler, {6}, object, (device-cuda, sm_35)
8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object
9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler
10: input, "cudatests.cu", cuda, (device-cuda, sm_37)
11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37)
12: compiler, {11}, ir, (device-cuda, sm_37)
13: backend, {12}, assembler, (device-cuda, sm_37)
14: assembler, {13}, object, (device-cuda, sm_37)
15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object
16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler
17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda)
18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir
19: backend, {18}, assembler
20: assembler, {19}, object
21: input, "cuda", object
22: input, "cudart", object
23: linker, {20, 21, 22}, image
```
The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine.

Reviewers: echristo, hfinkel, jlebar, ABataev, tra

Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

Differential Revision: https://reviews.llvm.org/D18171

llvm-svn: 275645
2016-07-15 23:13:27 +00:00
..
ARCMT [test/objcmt] Add a follow-up test case for r275600. 2016-07-15 20:40:24 +00:00
ASTMerge When importing classes and structs with anonymous structs, it is critical that 2016-07-14 19:53:44 +00:00
Analysis [analyzer] Add rudimentary handling of AtomicExpr. 2016-07-08 00:53:18 +00:00
CXX Push alias-declarations and alias-template declarations into scope even if 2016-07-15 20:53:25 +00:00
CodeCompletion [CodeCompletion] Allow system headers providing private symbols with a single underscore. 2016-07-01 01:17:02 +00:00
CodeGen Add XRay flags to Clang. We implement two flags to control the XRay behaviour: 2016-07-13 22:32:15 +00:00
CodeGenCUDA NVPTX: Use the nvvm builtins to read SRegs rather than the legacy ptx ones 2016-07-07 16:41:08 +00:00
CodeGenCXX P0305R0: Semantic analysis and code generation for C++17 init-statement for 'if' and 'switch': 2016-07-14 00:11:03 +00:00
CodeGenObjC Allow 'nodebug' on local variables. 2016-06-16 00:42:36 +00:00
CodeGenObjCXX Fix mangled name of method with ns_consumed parameters. 2016-05-25 14:15:08 +00:00
CodeGenOpenCL AMDGPU: Remove legacy ldexp builtin 2016-07-15 21:33:06 +00:00
Coverage
CoverageMapping [Coverage] Do not map regions from system headers 2016-07-11 22:57:46 +00:00
Driver [CUDA][OpenMP] Create generic offload action 2016-07-15 23:13:27 +00:00
FixIt ObjC Class Property: diagnostics when accessing a class property using instance. 2016-06-28 23:01:49 +00:00
Format
Frontend [OpenCL] Actually activate Frontend/opencl.cl test and fix test bugs 2016-07-14 12:56:21 +00:00
Headers Attempting to fix lit test test/Headers/opencl-c-header.cl on cygwin. 2016-06-27 21:43:00 +00:00
Index [index] Create different USR if a property is a class property. 2016-07-15 22:18:19 +00:00
Integration
Layout [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version) 2016-05-23 17:16:12 +00:00
Lexer Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths. 2016-06-13 20:40:21 +00:00
Misc P0305R0: Semantic analysis and code generation for C++17 init-statement for 'if' and 'switch': 2016-07-14 00:11:03 +00:00
Modules Revert r275481, r275490. This broke modules bootstrap. 2016-07-15 21:33:46 +00:00
OpenMP [OpenMP] add check for both simdlen and safelen clauses specified 2016-07-15 04:39:07 +00:00
PCH The test added in r275267 does not work on read-only checkouts because of the use of touch -m -t. 2016-07-14 13:58:27 +00:00
Parser P0305R0: Semantic analysis and code generation for C++17 init-statement for 'if' and 'switch': 2016-07-14 00:11:03 +00:00
Preprocessor [Driver][AArch64] Add support for Broadcom Vulcan core. 2016-06-29 10:00:31 +00:00
Profile Remove MaxFunctionCount module flag annotation. 2016-06-20 20:48:32 +00:00
Rewriter
Sema Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
SemaCUDA [CUDA] Add additional testcases for EraseUnwantedCUDAMatches. 2016-07-12 23:23:12 +00:00
SemaCXX Push alias-declarations and alias-template declarations into scope even if 2016-07-15 20:53:25 +00:00
SemaObjC Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
SemaObjCXX Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
SemaOpenCL [OpenCL] Improved diagnostics of OpenCL types. 2016-07-11 13:46:02 +00:00
SemaTemplate Push alias-declarations and alias-template declarations into scope even if 2016-07-15 20:53:25 +00:00
TableGen
Tooling Back out the test case for r266973 for now. 2016-04-21 10:46:14 +00:00
Unit Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 06:54:46 +00:00
VFS [VFS] Fix status() of opened redirected file 2015-12-10 23:41:39 +00:00
.clang-format
CMakeLists.txt Re-apply "test: Use add_lit_testsuites so that subsets of tests can be specified" 2016-07-05 17:54:40 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg Port some more debug info tests on Windows 2016-06-30 17:41:27 +00:00
lit.site.cfg.in Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 06:54:46 +00:00
make_test_dirs.pl