summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/HIP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [HIP] use GetProgramPath for executable discoveryHolger Wünsche2020-01-221-15/+8
| | | | | | | | | | | This change replaces the manual building of executable paths using llvm::sys::path::append with GetProgramPath. This enables adding other paths in case executables reside in different directories and makes the code easier to read. Differential Revision: https://reviews.llvm.org/D72903 (cherry picked from commit 24d7a0935bea390fc444f6ac8cf02447fe8d6917)
* [HIP] Add option --gpu-max-threads-per-block=nYaxun (Sam) Liu2020-01-071-0/+8
| | | | | | Add this option to change the default launch bounds. Differential Revision: https://reviews.llvm.org/D71221
* [AMDGPU][HIP] Improve opt-level handlingScott Linder2019-12-051-23/+38
| | | | | | | | | | | | | | | | | Summary: The HIP toolchain invokes `llc` without an explicit opt-level, meaning it always uses the default (-O2). This makes it impossible to use -O1, for example. The HIP toolchain also coerces -Os/-Oz to -O2 even when invoking opt, and it coerces -Og to -O2 rather than -O1. Forward the opt-level to `llc` as well as `opt`, and only coerce levels where it is required. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70987
* [HIP] Remove opencl.amdgcn.libYaxun (Sam) Liu2019-12-041-3/+2
| | | | Differential Revision: https://reviews.llvm.org/D70980
* [hip] Allow the declaration of functions with variadic arguments in HIP.Michael Liao2019-10-251-0/+2
| | | | | | | | | | | | | | | | | Summary: - As variadic parameters have the lowest rank in overload resolution, without real usage of `va_arg`, they are commonly used as the catch-all fallbacks in SFINAE. As the front-end still reports errors on calls to `va_arg`, the declaration of functions with variadic arguments should be allowed in general. Reviewers: jlebar, tra, yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69389
* [HIP] Add option -fgpu-allow-device-initYaxun (Sam) Liu2019-10-221-0/+4
| | | | | | | | | | | | | | Add this option to allow device side class type global variables with non-trivial ctor/dtor. device side init/fini functions will be emitted, which will be executed by HIP runtime when the fat binary is loaded/unloaded. This feature is to facilitate implementation of device side sanitizer which requires global vars with non-trival ctors. By default this option is disabled. Differential Revision: https://reviews.llvm.org/D69268
* [HIP] Fix -save-tempsYaxun Liu2019-10-091-18/+31
| | | | | | | | | | Currently clang does not save some of the intermediate file generated during device compilation for HIP when -save-temps is specified. This patch fixes that. Differential Revision: https://reviews.llvm.org/D68665 llvm-svn: 374198
* [HIP] Use option -nogpulib to disable linking device libYaxun Liu2019-10-031-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D68300 llvm-svn: 373649
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-5/+5
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* Fix _WIN32 / _WIN64 Wundef warningsSven van Haastregt2019-08-141-1/+1
| | | | | | | | For these macros it is the definedness that matters rather than the value. Make new uses of these macros consistent with existing uses. llvm-svn: 368822
* [HIP] Support attribute hip_pinned_shadowYaxun Liu2019-06-261-3/+2
| | | | | | | | | | | | | | | This patch introduces support of hip_pinned_shadow variable for HIP. A hip_pinned_shadow variable is a global variable with attribute hip_pinned_shadow. It has external linkage on device side and has no initializer. It has internal linkage on host side and has initializer or static constructor. It can be accessed in both device code and host code. This allows HIP runtime to implement support of HIP texture reference. Differential Revision: https://reviews.llvm.org/D62738 llvm-svn: 364381
* [AMDGPU] gfx1010 wave32 clang supportStanislav Mekhanoshin2019-06-131-2/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D63209 llvm-svn: 363341
* Revert r344630 Disable code object version 3 for HIP toolchain.Yaxun Liu2019-06-111-1/+1
| | | | | | Remove the workaround so that by default code object v3 is enabled. llvm-svn: 363076
* [AMDGPU] gfx1010 clang targetStanislav Mekhanoshin2019-05-131-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D61875 llvm-svn: 360634
* [HIP] Use -mlink-builtin-bitcode to link device libraryYaxun Liu2019-04-121-40/+41
| | | | | | | | | | | | Use -mlink-builtin-bitcode instead of llvm-link to link device library so that device library bitcode and user device code can be compiled in a consistent way. This is the same approach used by CUDA and OpenMP. Differential Revision: https://reviews.llvm.org/D60513 llvm-svn: 358290
* [HIP-Clang] propagate -mllvm options to opt and llcAaron Enye Shi2019-03-151-0/+9
| | | | | | | | | | Change the HIP Toolchain to pass the OPT_mllvm options into OPT and LLC stages. Added a lit test to verify the command args. Reviewers: yaxunl Differential Revision: https://reviews.llvm.org/D59316 llvm-svn: 356277
* Partial revert of r353952: [HIP] Handle compile -m options and propagate ↵Yaxun Liu2019-02-281-2/+2
| | | | | | | | | | | | | | into LLC Remove comments and tests about passing -mcode-object-v3 to driver since it does not work. Other -m options are OK. Also put back -mattr=-code-object-v3 since HIP is still not ready for code object v3. Differential Revision: https://reviews.llvm.org/D57977 llvm-svn: 355106
* [HIP] Handle compile -m options and propagate into LLCAaron Enye Shi2019-02-131-2/+20
| | | | | | | | | | | Allow the compile options for -m such as -mxnack/-mno-xnack, -msram-ecc/-mno-sram-ecc, -mcode-object-v3/-mno-code-object-v3 to propagate into LLC args. Fix an issue where -mattr was pushed even when it was empty. Also add lit tests to verify features are properly passed. Differential Revision: https://reviews.llvm.org/D57977 Reviewers: yaxunl, kzhuravl llvm-svn: 353952
* Revert r353880 "[HIP] Handle compile -m options and propagate into LLC"Reid Kleckner2019-02-121-19/+2
| | | | | | This was still causing test failures in the clang test suite. llvm-svn: 353893
* [HIP] Handle compile -m options and propagate into LLCAaron Enye Shi2019-02-121-2/+19
| | | | | | | | | | | Allow the compile options for -m such as -mxnack/-mno-xnack, -msram-ecc/-mno-sram-ecc, -mcode-object-v3/-mno-code-object-v3 to propagate into LLC args. Also add lit tests to verify features are properly passed. Differential Revision: https://reviews.llvm.org/D57977 Reviewers: yaxunl, kzhuravl llvm-svn: 353880
* Add -fapply-global-visibility-to-externs for -cc1Scott Linder2019-01-281-1/+3
| | | | | | | | | | | | | Introduce an option to request global visibility settings be applied to declarations without a definition or an explicit visibility, rather than the existing behavior of giving these default visibility. When the visibility of all or most extern definitions are known this allows for the same optimisations -fvisibility permits without updating source code to annotate all declarations. Differential Revision: https://reviews.llvm.org/D56868 llvm-svn: 352391
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [HIP] Use nul instead of /dev/null when running on windowsYaxun Liu2019-01-101-1/+7
| | | | | | | | When clang is running on windows, /dev/null is not available. Use nul as empty input file instead. Differential Revision: https://reviews.llvm.org/D56225 llvm-svn: 350885
* Disable code object version 3 for HIP toolchainYaxun Liu2018-10-161-1/+1
| | | | | | | | | AMDGPU backend will switch to code object version 3 by default. Since HIP runtime is not ready, disable it until the runtime is ready. Differential Revision: https://reviews.llvm.org/D53325 llvm-svn: 344630
* [HIP] Replace irif library with hip.amdgcn.bcAaron Enye Shi2018-10-111-2/+2
| | | | | | No longer use irif amdgcn library, instead we will use the previous fence functions from new hip.amdgcn.bc bitcode library. Update hip-device-libs.hip test as well. llvm-svn: 344281
* [HIP] Support early finalization of device code for -fno-gpu-rdcYaxun Liu2018-10-021-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original options as aliases. When -fgpu-rdc is off, clang will assume the device code in each translation unit does not call external functions except those in the device library, therefore it is possible to compile the device code in each translation unit to self-contained kernels and embed them in the host object, so that the host object behaves like usual host object which can be linked by lld. The benefits of this feature is: 1. allow users to create static libraries which can be linked by host linker; 2. amortized device code linking time. This patch modifies HIP action builder to insert actions for linking device code and generating HIP fatbin, and pass HIP fatbin to host backend action. It extracts code for constructing command for generating HIP fatbin as a function so that it can be reused by early finalization. It also modifies codegen of HIP host constructor functions to embed the device fatbin when it is available. Differential Revision: https://reviews.llvm.org/D52377 llvm-svn: 343611
* [HIP] Add -fvisibility hidden option to clangYaxun Liu2018-08-301-0/+6
| | | | | | | | | | AMDGPU target need -fvisibility hidden option for clang to work around a limitation of no PLT support, otherwise there is compilation error at -O0. Differential Revision: https://reviews.llvm.org/D51434 llvm-svn: 341077
* [HIP] pass -target-cpu when running the device-mode compilerYaxun Liu2018-07-241-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D49643 llvm-svn: 337793
* [HIP] Fix ordering of device-libs linkingAaron Enye Shi2018-06-271-1/+1
| | | | | | | | | | | | | | | Summary: HIP should link the bitcodes with caller functions before callee functions. Also added lit test to check the ordering of the linked bitcodes is matches. Reviewers: yaxunl, b-sumner Reviewed By: yaxunl, b-sumner Subscribers: cfe-commits, yaxunl, b-sumner, scchan Differential Revision: https://reviews.llvm.org/D48667 llvm-svn: 335774
* [HIP] Support flush denormals bitcodeAaron Enye Shi2018-06-271-1/+7
| | | | | | | | | | | | | | | Summary: Use oclc_daz_opt_on.amdgcn.bc bitcode when option fcuda-flush-denormal-to-zero is enabled, otherwise use oclc_daz_opt_off.amdgcn.bc bitcode. Added lit tests to verify that the correct bitcode is linked when -fcuda-flush-denormal-to-zero option is enabled or disabled. Reviewers: yaxunl, scchan, b-sumner Reviewed By: yaxunl, scchan, b-sumner Subscribers: cfe-commits, yaxunl Differential Revision: https://reviews.llvm.org/D48493 llvm-svn: 335765
* [HIP] Remove hip/hc.amdgcn.bc from HIP ToolchainsAaron Enye Shi2018-06-261-2/+2
| | | | | | | | | | | | | | | Summary: The hc.amdgcn.bc and hip.amdgcn.bc are removed in VDI build and no longer needed. Reviewers: yaxunl Reviewed By: yaxunl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48455 llvm-svn: 335634
* [Test] Initial test commit accessAaron Enye Shi2018-06-261-1/+1
| | | | llvm-svn: 335630
* Fix -Wunused in NDEBUG introduced by HIP r333484Sam McCall2018-05-301-3/+2
| | | | llvm-svn: 333514
* Add HIP toolchainYaxun Liu2018-05-301-0/+343
This patch adds HIP toolchain to support HIP language mode. It includes: Create specific compiler jobs for HIP. Choose specific libraries for HIP. With contribution from Greg Rodgers. Differential Revision: https://reviews.llvm.org/D45212 llvm-svn: 333484
OpenPOWER on IntegriCloud