[all-commits] [llvm/llvm-project] 0348ff: [SYCL] Basic code generation for SYCL kernel calle...

Tom Honermann via All-commits all-commits at lists.llvm.org
Thu Apr 17 06:15:06 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0348ff515854438cab8a48b79e8839cb99d48701
      https://github.com/llvm/llvm-project/commit/0348ff515854438cab8a48b79e8839cb99d48701
  Author: Tom Honermann <tom.honermann at intel.com>
  Date:   2025-04-17 (Thu, 17 Apr 2025)

  Changed paths:
    M clang/include/clang/AST/SYCLKernelInfo.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CMakeLists.txt
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    A clang/lib/CodeGen/CodeGenSYCL.cpp
    M clang/lib/CodeGen/CodeGenTypes.h
    M clang/lib/CodeGen/Targets/NVPTX.cpp
    A clang/test/CodeGenSYCL/kernel-caller-entry-point.cpp

  Log Message:
  -----------
  [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (#133030)

A function declared with the `sycl_kernel_entry_point` attribute,
sometimes called a SYCL kernel entry point function, specifies a pattern
from which the parameters and body of an offload entry point function,
sometimes called a SYCL kernel caller function, are derived.

SYCL kernel caller functions are emitted during SYCL device compilation.
Their parameters and body are derived from the `SYCLKernelCallStmt`
statement and `OutlinedFunctionDecl` declaration associated with their
corresponding SYCL kernel entry point function. A distinct SYCL kernel
caller function is generated for each SYCL kernel entry point function
defined as a non-inline function or ODR-used in the translation unit.

The name of each SYCL kernel caller function is parameterized by the
SYCL kernel name type specified by the `sycl_kernel_entry_point`
attribute attached to the corresponding SYCL kernel entry point
function. For the moment, the Itanium ABI mangled name for typeinfo data
(`_ZTS<type>`) is used to name these functions; a future change will
switch to a more appropriate naming scheme.

The calling convention used for a SYCL kernel caller function is target
dependent. Support for AMDGCN, NVPTX, and SPIR targets is currently
provided. These functions are required to observe the language
restrictions for SYCL devices as specified by the SYCL 2020
specification; this includes a forward progress guarantee and prohibits
recursion.

Only SYCL kernel caller functions, functions declared as
`SYCL_EXTERNAL`, and functions directly or indirectly referenced from
those functions should be emitted during device compilation. Pruning of
other declarations has not yet been implemented.

---------

Co-authored-by: Elizabeth Andrews <elizabeth.andrews at intel.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list