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

Aniket Lal via All-commits all-commits at lists.llvm.org
Mon Apr 7 03:40:17 PDT 2025


  Branch: refs/heads/users/lalaniket8/emit-device-version-of-openCL-kernel
  Home:   https://github.com/llvm/llvm-project
  Commit: df47d76994cb706430364bc5e878beb1f01e62fa
      https://github.com/llvm/llvm-project/commit/df47d76994cb706430364bc5e878beb1f01e62fa
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 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: 24e84d2fbb84190a81296739af549a966557d2f8
      https://github.com/llvm/llvm-project/commit/24e84d2fbb84190a81296739af549a966557d2f8
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 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: 3f35a63a257c828c6cd1b44a9227b815e7b4a790
      https://github.com/llvm/llvm-project/commit/3f35a63a257c828c6cd1b44a9227b815e7b4a790
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 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: ae8f16104503588451f809f5dde435d3aae8a7c4
      https://github.com/llvm/llvm-project/commit/ae8f16104503588451f809f5dde435d3aae8a7c4
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 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: 799178f14528b21bb3420a550c5ac156e56e32f0
      https://github.com/llvm/llvm-project/commit/799178f14528b21bb3420a550c5ac156e56e32f0
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 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: 721cfbba29a8d516ec7c76446f0af075d73f1f62
      https://github.com/llvm/llvm-project/commit/721cfbba29a8d516ec7c76446f0af075d73f1f62
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 2025)

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

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


  Commit: 65811587f2f9fa2800607e2824877cd2f90c167f
      https://github.com/llvm/llvm-project/commit/65811587f2f9fa2800607e2824877cd2f90c167f
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 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


  Commit: 1b8c7cf2c0b7c7b15296c34ec753bfb017deae81
      https://github.com/llvm/llvm-project/commit/1b8c7cf2c0b7c7b15296c34ec753bfb017deae81
  Author: anikelal <anikelal at amd.com>
  Date:   2025-04-07 (Mon, 07 Apr 2025)

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

  Log Message:
  -----------
  Minor fixes


Compare: https://github.com/llvm/llvm-project/compare/037f952deb34...1b8c7cf2c0b7

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