summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/openmp-offload.c
Commit message (Collapse)AuthorAgeFilesLines
* Slightly relax restriction on exact order arguments must appear.Douglas Yung2019-10-121-2/+2
| | | | llvm-svn: 374627
* [Clang][OpenMP Offload] Add new tool for wrapping offload device binariesSergey Dmitriev2019-10-091-119/+125
| | | | | | | | | | This patch removes the remaining part of the OpenMP offload linker scripts which was used for inserting device binaries into the output linked binary. Device binaries are now inserted into the host binary with a help of the wrapper bit-code file which contains device binaries as data. Wrapper bit-code file is dynamically created by the clang driver with a help of new tool clang-offload-wrapper which takes device binaries as input and produces bit-code file with required contents. Wrapper bit-code is then compiled to an object and resulting object is appended to the host linking by the clang driver. This is the second part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68166 llvm-svn: 374219
* [Clang][OpenMP Offload] Create start/end symbols for the offloading entry ↵Sergey Dmitriev2019-09-271-8/+0
| | | | | | | | | | | | table with a help of a linker Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from ".omp.offloading_entries" to "omp_offloading_entries" to use this feature. This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68070 llvm-svn: 373118
* [Driver] Move the "-o OUT -x TYPE SRC.c" flags to the end of -cc1Reid Kleckner2019-05-231-49/+53
| | | | | | | | | | | New -cc1 arguments, such as -faddrsig, have started appearing after the input name. I personally find it convenient for the input to be the last argument to the compile command line, since I often need to edit it when running crash reproduction scripts. Differential Revision: https://reviews.llvm.org/D62270 llvm-svn: 361530
* Further relax restriction in tests to include where "-E" and "-S" must appear.Douglas Yung2019-02-141-30/+30
| | | | | | Also updated a few instances of "-emit-llvm-bc" and "-emit-obj" that were missed in the previous change. llvm-svn: 354063
* Relax restriction in tests to where "-emit-llvm-bc" and "-emit-obj" must appear.Douglas Yung2019-02-141-16/+16
| | | | | | | The CHECK lines as structured were requiring them to appear only in a certain position while all that is really needed is to check that they are present. llvm-svn: 354001
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-281-2/+4
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 343335
* Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported fileAlexey Bataev2018-09-251-1/+1
| | | | | | | | | types." It reverts commit r342991 + several other commits intended to fix the tests. Still have some failed tests, need to investigate it. llvm-svn: 343002
* [OPENMP] Fix the test, NFC.Alexey Bataev2018-09-251-3/+2
| | | | | | Fixed test to pacify buildbot. llvm-svn: 342996
* [OPENMP] Fix failed test, NFC.Alexey Bataev2018-09-251-1/+0
| | | | llvm-svn: 342995
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-251-2/+4
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 342991
* [ADT] Normalize empty triple componentsPetr Hosek2018-08-081-68/+68
| | | | | | | | | | | | | | | | | LLVM triple normalization is handling "unknown" and empty components differently; for example given "x86_64-unknown-linux-gnu" and "x86_64-linux-gnu" which should be equivalent, triple normalization returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's config.sub returns "x86_64-unknown-linux-gnu" for both "x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the triple normalization to behave the same way, replacing empty triple components with "unknown". This addresses PR37129. Differential Revision: https://reviews.llvm.org/D50219 llvm-svn: 339294
* [test] Pass in fixed triple for openmp-offload.cJonas Hahnfeld2017-10-041-2/+2
| | | | | | | | This should fix the test on other architectures. Related to: https://reviews.llvm.org/D38372 llvm-svn: 314904
* [OpenMP] Fix passing of -m arguments correctlyJonas Hahnfeld2017-10-041-0/+8
| | | | | | | | | | The recent fix in D38258 was wrong: getAuxTriple() only returns non-null values for the CUDA toolchain. That is why the now added test for PPC and X86 failed. Differential Revision: https://reviews.llvm.org/D38372 llvm-svn: 314902
* [OpenMP] Fix passing of -m arguments to device toolchainJonas Hahnfeld2017-09-271-0/+48
| | | | | | | | | | | AuxTriple is not set if host and device share a toolchain. Also, removing an argument modifies the DAL which needs to be returned for future use. (Move tests back to offload-openmp.c as they are not related to GPUs.) Differential Revision: https://reviews.llvm.org/D38258 llvm-svn: 314329
* Fix memory leak in ToolChain::TranslateOpenMPTargetArgsJonas Hahnfeld2017-08-141-3/+0
| | | | | | | rL310433 introduced a code path where DAL is not returned and must be freed. This change allows to run openmp-offload.c when Clang is built with ASan. llvm-svn: 310817
* Disabling openmp-offload.c on linux until it is stabilized on all local ↵Alex Shlyapnikov2017-08-111-0/+3
| | | | | | | | configurations. Differential revision: https://reviews.llvm.org/D29660 llvm-svn: 310772
* [OpenMP] Move failing flag tests to disabled GPUGheorghe-Teodor Bercea2017-08-111-32/+0
| | | | | | | | offloading test file. This should prevent further errors with the sanitizer. Diff: D29660 llvm-svn: 310765
* [OpenMP] Enable previously successful offloading tests.Gheorghe-Teodor Bercea2017-08-111-21/+0
| | | | | | | | | | | | Create a separate test file to contain all tests for OpenMP offloading to GPUs. Make libdevice checking more robust by accounting for the case in which no libdevice is found. This changes are in connrection with diff: D29660 llvm-svn: 310718
* Disabling openmp-offload.c on linux until it is stabilized on all local ↵Alex Shlyapnikov2017-08-101-0/+3
| | | | | | configurations. llvm-svn: 310640
* [OpenMP] Delete tests in openmp-offload.c which cuase failuresGheorghe-Teodor Bercea2017-08-101-65/+0
| | | | | | | | until a better way to perform these tests is figured out. Change connected to diff: D29654 llvm-svn: 310625
* Revert r310489 and follow-up commits r310505, r310519, r310537 and r310549Alex Lorenz2017-08-101-19/+3
| | | | | | | | | | Commit r310489 caused 'openmp-offload.c' test failures on Darwin and other platforms: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/39230/testReport/junit/Clang/Driver/openmp_offload_c/ The follow-up commits tried to fix the test, but the test is still failing. llvm-svn: 310580
* [OpenMP] Remove offending test.Gheorghe-Teodor Bercea2017-08-091-8/+0
| | | | | Diff: D29660 llvm-svn: 310537
* [OpenMP] Fix failing test for D29660.Gheorghe-Teodor Bercea2017-08-091-3/+1
| | | | | | Non-functional change. llvm-svn: 310519
* [OpenMP] Make the PTX version tests general enough to work on all toolchains.Gheorghe-Teodor Bercea2017-08-091-6/+22
| | | | | | | | | | Add explicit test for Darwin and PowerPC. Clean-up tests. Non-functional change. Original diff: D29660 llvm-svn: 310505
* [OpenMP] Add flag for overwriting default PTX version for OpenMP targetsGheorghe-Teodor Bercea2017-08-091-2/+12
| | | | | | | | | | | | | | | | | Summary: This flag "--fopenmp-ptx=" enables the overwriting of the default PTX version used for GPU offloaded OpenMP target regions: "+ptx42". Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: ABataev Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29660 llvm-svn: 310489
* [OpenMP] Add flag for disabling the default generation of relocatable OpenMP ↵Gheorghe-Teodor Bercea2017-08-091-0/+17
| | | | | | | | | | | | | | | | target code for NVIDIA GPUs. Summary: Previously we have added the "-c" flag which gets passed to PTXAS by default to generate relocatable OpenMP target code by default. This set of flags exposes control over this behaviour. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: ABataev Subscribers: Hahnfeld, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29659 llvm-svn: 310484
* [OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by defaultGheorghe-Teodor Bercea2017-08-091-0/+8
| | | | | | | | | Original Diff: D29642 This patch was previously reverted due to an error with patch D29654 that this depends on. llvm-svn: 310479
* [OpenMP] Fix bug regarding cubin integration into host binaryGheorghe-Teodor Bercea2017-08-091-0/+20
| | | | | | | | | | when a BindArchAction is used. This is not a functional change. Original Diff: D29654 llvm-svn: 310433
* Non-functional change. Fix test for D29654.Gheorghe-Teodor Bercea2017-08-081-1/+1
| | | | llvm-svn: 310368
* [OpenMP] OpenMP device offloading code generation produces a cubin file ↵Gheorghe-Teodor Bercea2017-08-081-0/+38
| | | | | | | | which is then integrated in the host binary using the host linker. Diff: D29654 llvm-svn: 310362
* Revert r310291, r310300 and r310332 because of test failure on DarwinAlex Lorenz2017-08-081-48/+0
| | | | | | | | | | | | | | | | | | | | | The commit r310291 introduced the failure. r310332 was a test fix commit and r310300 was a followup commit. I reverted these two to avoid merge conflicts when reverting. The 'openmp-offload.c' test is failing on Darwin because the following run lines: // RUN: touch %t1.o // RUN: touch %t2.o // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -save-temps -no-canonical-prefixes %t1.o %t2.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s trigger the following assertion: Driver.cpp:3418: assert(CachedResults.find(ActionTC) != CachedResults.end() && "Result does not exist??"); llvm-svn: 310345
* Fix openmp-offload.c test on WindowsReid Kleckner2017-08-081-2/+2
| | | | llvm-svn: 310332
* [OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by defaultGheorghe-Teodor Bercea2017-08-071-0/+8
| | | | | | | | | | | | | | Summary: When device offloading is enabled and the device is an NVIDIA GPU, OpenMP target regions must be compiled with relocation enabled by passing the "-c" flag to the PTXAS invocation. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: Hahnfeld, rengolin, mkuron, cfe-commits Differential Revision: https://reviews.llvm.org/D29642 llvm-svn: 310300
* [OpenMP] Integrate OpenMP target region cubin into host binaryGheorghe-Teodor Bercea2017-08-071-0/+40
| | | | | | | | | | | | | | Summary: OpenMP device offloading code generation produces a cubin file which is then integrated in the host binary using the host linker. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, rnk, hfinkel, tstellar Reviewed By: hfinkel Subscribers: sfantao, rnk, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29654 llvm-svn: 310291
* Add some missing -no-canonical-prefixes.Benjamin Kramer2017-08-071-4/+4
| | | | llvm-svn: 310278
* [OpenMP] Add flag for specifying the target device architecture for OpenMP ↵Gheorghe-Teodor Bercea2017-08-071-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | device offloading Summary: OpenMP has the ability to offload target regions to devices which may have different architectures. A new -fopenmp-target-arch flag is introduced to specify the device architecture. In this patch I use the new flag to specify the compute capability of the underlying NVIDIA architecture for the OpenMP offloading CUDA tool chain. Only a host-offloading test is provided since full device offloading capability will only be available when [[ https://reviews.llvm.org/D29654 | D29654 ]] lands. Reviewers: hfinkel, Hahnfeld, carlo.bertolli, caomhin, ABataev Reviewed By: hfinkel Subscribers: guansong, cfe-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D34784 llvm-svn: 310263
* Add -no-canonical-prefixes to the test line so that we can handle different ↵Eric Christopher2017-06-301-1/+1
| | | | | | build modes. llvm-svn: 306790
* Fix openmp-offload.c test on WindowsReid Kleckner2017-06-291-2/+2
| | | | llvm-svn: 306751
* [OpenMP] Fix test for revision D29645. NFCGheorghe-Teodor Bercea2017-06-291-5/+3
| | | | llvm-svn: 306724
* [OpenMP] Pass -fopenmp-is-device to preprocessing and machine specific code ↵Gheorghe-Teodor Bercea2017-06-291-0/+10
| | | | | | | | | | | | | | | | generation stages Summary: The preprocessing and code generation and optimization stages of the compiler are also passed the "-fopenmp-is-device" flag. This is used to trigger machine specific preprocessing and code generation when performing device offloading to an NVIDIA GPU via OpenMP directives. Reviewers: arpith-jacob, caomhin, carlo.bertolli, Hahnfeld, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: Hahnfeld, rengolin Differential Revision: https://reviews.llvm.org/D29645 llvm-svn: 306691
* [OpenMP] Add support for auxiliary triple specificationGheorghe-Teodor Bercea2017-06-291-28/+28
| | | | | | | | | | | | | | Summary: Device offloading requires the specification of an additional flag containing the triple of the //other// architecture the code is being compiled on if such an architecture exists. If compiling for the host, the auxiliary triple flag will contain the triple describing the device and vice versa. Reviewers: arpith-jacob, sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29339 llvm-svn: 306689
* [OpenMP][Driver] Put target binary for each offload target into aAlexey Bataev2017-05-301-3/+5
| | | | | | | | | | | | | | separate section, by Sergey Dmitriev Linker script that is generated by the clang driver for creating fat binary puts target binaries for all offload targets into a single ELF section .omp_offloading. This is not convenient because it greatly complicates operations with the final fat binary once it is linked. For example extracting target binary for a particular target from such fat executable would not be an easy task if you have more than one offload target. Attached patch changes clang driver to put target binary for each offload target into a separate ELF section .omp_offloading.<target triple>. Differential Revision: https://reviews.llvm.org/D33254 llvm-svn: 304229
* Fix this test when we have clang-offload-bundler.exe.Rafael Espindola2016-10-311-10/+10
| | | | llvm-svn: 285561
* clang/test/Driver/openmp-offload.c: Relax expressions if "ld.exe" exists, ↵NAKAMURA Takumi2016-10-301-18/+18
| | | | | | like mingw. llvm-svn: 285511
* Define extra variable in OpenMP offloading driver tests.Samuel Antao2016-10-281-5/+8
| | | | llvm-svn: 285408
* Change OpenMP offload driver tests so that it doesn't use the full file path ↵Samuel Antao2016-10-281-87/+197
| | | | | | | | during tests. This was causing failures on windows bots. llvm-svn: 285404
* [openmp] Remove test assumption that canonical binary name contains "clang"Benjamin Kramer2016-10-281-15/+15
| | | | | | | | Patch by Sam McCall! Differential Revision: https://reviews.llvm.org/D26067 llvm-svn: 285388
* Use -fopenmp=libomp in all OpenMP offloading tests.Samuel Antao2016-10-271-24/+20
| | | | | | This will make sure the right features are being tested even for machines that default to libgomp. llvm-svn: 285327
* [Driver][OpenMP] Add support to create jobs for unbundling actions.Samuel Antao2016-10-271-2/+91
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the support to create jobs for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool to unbundle input files. Unlike other actions, unbundling actions have multiple outputs. Therefore, this patch adds the required changes to have a variant of `Tool::ConstructJob` with multiple outputs. The way the naming of the results is implemented is also slightly modified so that the same action can use a different offloading prefix for each use by the different offloading actions. With this patch, it is possible to compile a functional OpenMP binary with offloading support, even with separate compilation. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21857 llvm-svn: 285326
OpenPOWER on IntegriCloud