[clang] [CIR] Skip call-conv lowering on Windows x86_64 (PR #223583)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 19:26:04 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangir

Author: Adam Smith (adams381)

<details>
<summary>Changes</summary>

The x86-64 classifier implements SysV.  We do not support Windows yet.

Assisted-by: Cursor / claude-opus-5


---
Full diff: https://github.com/llvm/llvm-project/pull/223583.diff


2 Files Affected:

- (modified) clang/lib/CIR/Lowering/CIRPasses.cpp (+2-1) 
- (added) clang/test/CIR/CodeGen/call-conv-lowering-win64-skipped.c (+18) 


``````````diff
diff --git a/clang/lib/CIR/Lowering/CIRPasses.cpp b/clang/lib/CIR/Lowering/CIRPasses.cpp
index 64d82dd4e7301..d164d55f512cc 100644
--- a/clang/lib/CIR/Lowering/CIRPasses.cpp
+++ b/clang/lib/CIR/Lowering/CIRPasses.cpp
@@ -24,7 +24,8 @@ namespace cir {
 /// Map a target triple to the ABI target that drives CallConvLowering.
 /// Returns None for targets whose calling convention is not yet implemented.
 static CallConvTarget getCallConvTarget(const llvm::Triple &triple) {
-  if (triple.getArch() == llvm::Triple::x86_64)
+  // Windows is not supported.  UEFI shares its convention.
+  if (triple.getArch() == llvm::Triple::x86_64 && !triple.isOSWindowsOrUEFI())
     return CallConvTarget::X86_64;
   return CallConvTarget::None;
 }
diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-win64-skipped.c b/clang/test/CIR/CodeGen/call-conv-lowering-win64-skipped.c
new file mode 100644
index 0000000000000..f72bba7e31f3a
--- /dev/null
+++ b/clang/test/CIR/CodeGen/call-conv-lowering-win64-skipped.c
@@ -0,0 +1,18 @@
+// RUN: not %clang_cc1 -triple x86_64-pc-windows-gnu -Wno-unused-value -fclangir -emit-llvm %s -o - | FileCheck %s --check-prefix=WIN64
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o - | FileCheck %s --check-prefix=SYSV
+
+struct S16 {
+  long long a;
+  long long b;
+};
+
+void take16(struct S16 s);
+
+void give16(void) {
+  struct S16 s = {1, 2};
+  take16(s);
+}
+
+// Windows is not supported, so its signature is left as CIRGen emitted it.
+// WIN64: declare void @take16(%struct.S16)
+// SYSV:  declare void @take16(i64, i64)

``````````

</details>


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


More information about the cfe-commits mailing list