[all-commits] [llvm/llvm-project] 9ae581: [HIPSPV] Convert HIP kernels to SPIR-V kernels

linehill via All-commits all-commits at lists.llvm.org
Wed Dec 8 04:18:34 PST 2021


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

  Changed paths:
    M clang/lib/CodeGen/TargetInfo.cpp
    A clang/test/CodeGenHIP/hipspv-kernel.cpp

  Log Message:
  -----------
  [HIPSPV] Convert HIP kernels to SPIR-V kernels

This patch translates HIP kernels to SPIR-V kernels when the HIP
compilation mode is targeting SPIR-S. This involves:

* Setting Cuda calling convention to CC_OpenCLKernel (which maps to
  SPIR_KERNEL in LLVM IR later on).

* Coercing pointer arguments with default address space (AS) qualifier
  to CrossWorkGroup AS (__global in OpenCL). HIPSPV's device code is
  ultimately SPIR-V for OpenCL execution environment (as
  starter/default) where Generic or Function (OpenCL's private) is not
  supported as storage class for kernel pointer types. This leaves the
  CrossWorkGroup to be the only reasonable choice for HIP buffers.

Reviewed By: yaxunl

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




More information about the All-commits mailing list