[clang] [CIR] Enable x86_64 calling-convention lowering by default (PR #215026)
Adam Smith via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 14:02:17 PDT 2026
================
@@ -16,13 +16,21 @@ void f2(void) {
f1(s);
}
+// S is one eightbyte of INTEGER class, so it is passed as one i64.
// CIR-LABEL: cir.func{{.*}} @f2(){{.*}} {
+// CIR: %[[COERCE:.+]] = cir.alloca "coerce" align(8) : !cir.ptr<!rec_S>
// CIR: %[[S:.+]] = cir.load align(4) %{{.+}} : !cir.ptr<!rec_S>, !rec_S
-// CIR-NEXT: cir.call @f1(%[[S]]) : (!rec_S) -> ()
+// CIR-NEXT: cir.store %[[S]], %[[COERCE]] : !rec_S, !cir.ptr<!rec_S>
+// CIR-NEXT: %[[CAST:.+]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<!rec_S> -> !cir.ptr<!u64i>
+// CIR-NEXT: %[[ARG:.+]] = cir.load %[[CAST]] : !cir.ptr<!u64i>, !u64i
+// CIR-NEXT: cir.call @f1(%[[ARG]]) : (!u64i) -> ()
// LLVM-LABEL: define{{.*}} void @f2(){{.*}}
+// LLVM: %[[COERCE:.+]] = alloca %struct.S, i64 1, align 8
----------------
adams381 wrote:
After our discussion offline, I will open a new PR to address these after this merges.
https://github.com/llvm/llvm-project/pull/215026
More information about the cfe-commits
mailing list