[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 19 06:28:15 PDT 2022


JonChesterfield created this revision.
JonChesterfield added reviewers: arsenm, rampitec, sdesmalen, rjmccall, rnk, aaron.ballman.
Herald added subscribers: kosarev, kerbowa, t-tye, Anastasia, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
JonChesterfield requested review of this revision.
Herald added subscribers: cfe-commits, wdng.
Herald added a project: clang.

Allows emitting define amdgpu_kernel void @func() IR from C or C++.

This replaces the current workflow which is to write a stub in opencl that
calls an external C function implemented in C++ combined through llvm-link.

Calling the resulting function still requires a manual implementation of the
ABI from the host side. The primary application is for more rapid debugging
of the amdgpu backend by permuting a C or C++ test file instead of manually
updating an IR file.

Implementation closely follows D54425 <https://reviews.llvm.org/D54425>. Non-amd reviewers from there.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125970

Files:
  clang/include/clang/Basic/Attr.td
  clang/include/clang/Basic/Specifiers.h
  clang/lib/AST/ItaniumMangle.cpp
  clang/lib/AST/Type.cpp
  clang/lib/AST/TypePrinter.cpp
  clang/lib/Basic/Targets/AMDGPU.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/Sema/callingconv.c
  clang/tools/libclang/CXType.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125970.430653.patch
Type: text/x-patch
Size: 8272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220519/e6b2fffb/attachment-0001.bin>


More information about the cfe-commits mailing list