[clang] [CIR][SPIR-V] Set spir_kernel calling convention for AMDGCN-flavored HIP kernels (PR #214246)

Arseniy Obolenskiy via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 03:44:19 PDT 2026


================
@@ -42,11 +42,18 @@ class SPIRVTargetCIRGenInfo : public TargetCIRGenInfo {
     if (!fd)
       return;
 
+    auto func = mlir::cast<cir::FuncOp>(global);
+
     if (cgm.getLangOpts().OpenCL &&
         DeviceKernelAttr::isOpenCLSpelling(fd->getAttr<DeviceKernelAttr>())) {
-      auto func = mlir::cast<cir::FuncOp>(global);
       func.setCallingConv(cir::CallingConv::SpirKernel);
+      return;
     }
+
+    if (cgm.getLangOpts().HIP &&
+        cgm.getTriple().getVendor() == llvm::Triple::AMD &&
----------------
aobolensk wrote:

Removed the triple check

https://github.com/llvm/llvm-project/pull/214246


More information about the cfe-commits mailing list