[HIP] Do not call opt/llc for -fno-gpu-rdc
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 9 Jun 2020 19:02:53 +0000 (15:02 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Mon, 15 Jun 2020 22:55:01 +0000 (18:55 -0400)
commite8090d83fd92cc6a9d03b48c91f979bbfa6bb1fc
tree0046fea36b48832bc4031e1bd8b23b2b8ad6c905
parent64ec505dd46832880350e8b45316eaed30b458dc
[HIP] Do not call opt/llc for -fno-gpu-rdc

Currently HIP toolchain calls clang to emit bitcode then calls opt/llc for device compilation for the default -fno-gpu-rdc
case, which is unnecessary since clang is able to compile a single source file to ISA.

This patch fixes the HIP action builder and toolchain so that the default -fno-gpu-rdc can be done like a canonical
toolchain, i.e. one clang -cc1 invocation to compile source code to ISA.

This can avoid unnecessary processes to speed up the compilation, and avoid redundant LLVM passes which are
performed in clang -cc1 and opt.

Differential Revision: https://reviews.llvm.org/D81627
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/HIP.cpp
clang/test/Driver/cuda-phases.cu
clang/test/Driver/hip-binding.hip
clang/test/Driver/hip-device-compile.hip
clang/test/Driver/hip-phases.hip [new file with mode: 0644]
clang/test/Driver/hip-save-temps.hip
clang/test/Driver/hip-toolchain-mllvm.hip
clang/test/Driver/hip-toolchain-no-rdc.hip
clang/test/Driver/hip-toolchain-opt.hip