[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 19:25:36 PDT 2020


yaxunl created this revision.
yaxunl added a reviewer: tra.
Herald added a subscriber: tpr.

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.

This patch does not remove opt/llc in -fgpu-rdc case since device linking is still needed whereas
amdgpu backend does not support ISA linking for now.


https://reviews.llvm.org/D81627

Files:
  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
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81627.270019.patch
Type: text/x-patch
Size: 52264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200611/b7de03a3/attachment-0001.bin>


More information about the cfe-commits mailing list