[all-commits] [llvm/llvm-project] 4e94cb: [HIPSPV][2/4] Add HIPSPV tool chain

Henry Linjamäki via All-commits all-commits at lists.llvm.org
Tue Dec 14 10:23:28 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e94cba5b4e431794026085b89a34112b2d9ac0d
      https://github.com/llvm/llvm-project/commit/4e94cba5b4e431794026085b89a34112b2d9ac0d
  Author: Henry Linjamäki <henry.linjamaki at parmance.com>
  Date:   2021-12-14 (Tue, 14 Dec 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/CMakeLists.txt
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    A clang/lib/Driver/ToolChains/HIPSPV.cpp
    A clang/lib/Driver/ToolChains/HIPSPV.h

  Log Message:
  -----------
  [HIPSPV][2/4] Add HIPSPV tool chain

This patch adds a new tool chain, HIPSPVToolChain, for emitting HIP
device code as SPIR-V binary. The SPIR-V binary is emitted by using an
external tool, SPIRV-LLVM-Translator, temporarily. We intend to switch
the translator to the llc tool when the SPIR-V backend lands on LLVM
and proves to work well on HIP implementations which consume SPIR-V.

Before the SPIR-V emission the tool chain loads an optional external
pass plugin, either automatically from a HIP installation or from a
path pointed by --hipspv-pass-plugin, and runs passes that are meant
to expand/lower HIP features that do not have direct counterpart in
SPIR-V (e.g. dynamic shared memory).

Code emission for SPIR-V will be enabled and HIPSPVToolChain tests
will be added in the follow up patch part 3.

Other changes: New option ‘-nohipwrapperinc’ is added to exclude HIP
include wrappers. The reason for the addition is that they cause
compile errors when compiling HIP sources for the host side for HIPCL
and HIPLZ implementations. New option is added to avoid this issue.

Reviewed By: tra

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




More information about the All-commits mailing list