[PATCH] D110618: [HIPSPV][2/4] Add HIPSPV tool chain

Henry Linjamäki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 28 05:20:23 PDT 2021


linjamaki created this revision.
Herald added subscribers: dang, kerbowa, yaxunl, mgorny, nhaehnle, jvesely.
linjamaki updated this revision to Diff 375526.
linjamaki added a comment.
linjamaki published this revision for review.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Style fixes.


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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110618

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/CMakeLists.txt
  clang/lib/Driver/ToolChains/AMDGPU.cpp
  clang/lib/Driver/ToolChains/HIPSPV.cpp
  clang/lib/Driver/ToolChains/HIPSPV.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110618.375526.patch
Type: text/x-patch
Size: 19458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210928/47aad83a/attachment-0001.bin>


More information about the cfe-commits mailing list