[clang] [CIR] Enable CallConvLowering for SPIRV triples (PR #244409)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 14:05:50 PST 2026


================
@@ -32,6 +34,11 @@ static CallConvTarget getCallConvTarget(const llvm::Triple &triple) {
   if (triple.isAArch64() && !triple.isOSWindows() &&
       triple.getArch() != llvm::Triple::aarch64_32)
     return CallConvTarget::AArch64;
+  bool isHLSL = loweringLangOpts && loweringLangOpts.getHlsl();
+  // AMDGCN-flavored SPIR-V follows the AMDGPU ABI instead. HLSL's integer
+  // promotion rules and resource types are not modeled yet.
+  if (triple.isSPIRV() && triple.getVendor() != llvm::Triple::AMD && !isHLSL)
+    return CallConvTarget::SPIRV;
----------------
andykaylor wrote:

I'd be OK with blocking this path for any target combination where you think it shouldn't go forward yet. Eventually, we'll want to match classic codegen's behavior, which if I'm reading it correctly, is to only require special handling for SPIR-V if the vendor is AMD. It looks to me like the handling for all other SPIR cases goes to a common ABI classifier. As long as parts of that are unimplemented, I'm happy with whatever you think is best for the partial implementation to progress.

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


More information about the cfe-commits mailing list