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

Aniket Lal via All-commits all-commits at lists.llvm.org
Wed Mar 19 01:19:05 PDT 2025


  Branch: refs/heads/users/lalaniket8/emit-device-version-of-openCL-kernel
  Home:   https://github.com/llvm/llvm-project
  Commit: 748b074b3d28753ebb57a9c5efcb4dde157ef519
      https://github.com/llvm/llvm-project/commit/748b074b3d28753ebb57a9c5efcb4dde157ef519
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-19 (Wed, 19 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: 3cbecfa431a5c782b4b1c7367cb3743028a778c4
      https://github.com/llvm/llvm-project/commit/3cbecfa431a5c782b4b1c7367cb3743028a778c4
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-19 (Wed, 19 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: 8e0737764882082a4bcfe889cf8ebd326f12d363
      https://github.com/llvm/llvm-project/commit/8e0737764882082a4bcfe889cf8ebd326f12d363
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-19 (Wed, 19 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: 8a10aaea342445e79d986ba0894b73487db98893
      https://github.com/llvm/llvm-project/commit/8a10aaea342445e79d986ba0894b73487db98893
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-19 (Wed, 19 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: f76226a86f6aba9f1080b154a565158ed3cafe51
      https://github.com/llvm/llvm-project/commit/f76226a86f6aba9f1080b154a565158ed3cafe51
  Author: anikelal <anikelal at amd.com>
  Date:   2025-03-19 (Wed, 19 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
    M clang/test/CodeGenOpenCL/implicit-addrspacecast-function-parameter.cl

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


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

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp

  Log Message:
  -----------
  Changing dyn_cast and assert to cast


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

  Changed paths:
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CodeGenModule.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-enqueue-kernel.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/implicit-addrspacecast-function-parameter.cl
    M clang/test/CodeGenOpenCL/opencl-kernel-call.cl
    M clang/test/CodeGenOpenCL/reflect.cl
    M clang/test/CodeGenOpenCL/sampler.cl
    M clang/test/CodeGenOpenCL/spir-calling-conv.cl
    M clang/test/Frontend/amdgcn-machine-analysis-remarks.cl

  Log Message:
  -----------
  Removed always-inline attribute from stubs and made required littest changes


Compare: https://github.com/llvm/llvm-project/compare/90ce3d9fc599...7429b979c29c

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