[all-commits] [llvm/llvm-project] 85bbe5: [Clang][OpenCL][AMDGPU] Allow a kernel to call ano...

Aniket Lal via All-commits all-commits at lists.llvm.org
Wed Mar 12 05:18:51 PDT 2025


  Branch: refs/heads/users/lalaniket8/emit-device-version-of-openCL-kernel
  Home:   https://github.com/llvm/llvm-project
  Commit: 85bbe5c5bd392153f335664f4c4d4823505b27a6
      https://github.com/llvm/llvm-project/commit/85bbe5c5bd392153f335664f4c4d4823505b27a6
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M clang/include/clang/AST/GlobalDecl.h
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/Mangle.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/CodeGen/CGBlocks.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CGOpenCLRuntime.cpp
    M clang/lib/CodeGen/CGOpenCLRuntime.h
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGenOpenCL/opencl-kernel-call.cl
    M clang/test/CodeGenOpenCL/spir-calling-conv.cl
    M clang/test/CodeGenOpenCL/visibility.cl

  Log Message:
  -----------
  [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel

This feature is currently not supported in the compiler.
To facilitate this we emit a stub version of each kernel
function body with different name mangling scheme, and
replaces the respective kernel call-sites appropriately.

Fixes https://github.com/llvm/llvm-project/issues/60313

D120566 was an earlier attempt made to upstream a solution
for this issue.


  Commit: 9ff0334e751f5bd71e7b908b7cec5e45b7c56566
      https://github.com/llvm/llvm-project/commit/9ff0334e751f5bd71e7b908b7cec5e45b7c56566
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M clang/include/clang/AST/GlobalDecl.h
    M clang/lib/CodeGen/CGOpenCLRuntime.cpp

  Log Message:
  -----------
  [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel

Simplifying isDeclOpenCLKernel() and removing resolved comments


  Commit: 3783e25202d4eda62e9fd813c5586462ecda8bfa
      https://github.com/llvm/llvm-project/commit/3783e25202d4eda62e9fd813c5586462ecda8bfa
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/GlobalDecl.h
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/Mangle.cpp
    M clang/lib/CodeGen/CGBlocks.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CGOpenCLRuntime.cpp
    M clang/lib/CodeGen/CGOpenCLRuntime.h
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenTypes.h
    M clang/lib/CodeGen/TargetInfo.h
    M clang/lib/CodeGen/Targets/AMDGPU.cpp
    M clang/lib/CodeGen/Targets/SPIR.cpp
    M clang/lib/CodeGen/Targets/X86.cpp
    M clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
    M clang/test/CodeGenOpenCL/amdgpu-abi-struct-arg-byref.cl
    M clang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl
    M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
    M clang/test/CodeGenOpenCL/amdgpu-printf.cl
    M clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
    M clang/test/CodeGenOpenCL/cl20-device-side-enqueue-attributes.cl
    M clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
    M clang/test/CodeGenOpenCL/convergent.cl
    M clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl
    M clang/test/CodeGenOpenCL/kernel-arg-info.cl
    M clang/test/CodeGenOpenCL/opencl-kernel-call.cl
    M clang/test/CodeGenOpenCL/reflect.cl
    M clang/test/CodeGenOpenCL/spir-calling-conv.cl
    M clang/test/CodeGenOpenCL/visibility.cl
    M clang/test/CodeGenOpenCLCXX/addrspace-of-this.clcpp

  Log Message:
  -----------
  Emitting OpenCL Kernels as calls to their respective inlined stubs to avoid double emission of kernel body.


  Commit: 0a51053bf65002bdcc742d90391bf856cfd156ac
      https://github.com/llvm/llvm-project/commit/0a51053bf65002bdcc742d90391bf856cfd156ac
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/CodeGen/TargetInfo.h
    M clang/lib/CodeGen/Targets/AMDGPU.cpp
    M clang/lib/CodeGen/Targets/X86.cpp
    M clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
    M clang/test/CodeGenOpenCL/opencl-kernel-call.cl

  Log Message:
  -----------
  Set correct calling convention for stubs in X86 and SPIR targets
Test aggregate paratemers passed byref and byval


  Commit: 665db4b399e388e562cb354e4a264355d4fae76f
      https://github.com/llvm/llvm-project/commit/665db4b399e388e562cb354e4a264355d4fae76f
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
    M clang/test/CodeGenOpenCL/amdgpu-abi-struct-arg-byref.cl
    M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl

  Log Message:
  -----------
  Update tests


Compare: https://github.com/llvm/llvm-project/compare/d1e9e94a00b3...665db4b399e3

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