[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 28 11:08:34 PDT 2025


================
@@ -17,3 +17,15 @@ int f4() {
 // CHECK-LABEL: cir.func @f4() -> !s32i
 // CHECK:         %[[#x:]] = cir.call @f3() : () -> !s32i
 // CHECK-NEXT:    cir.store %[[#x]], %{{.+}} : !s32i, !cir.ptr<!s32i>
+
+int f5(int a, int *b, bool c);
+int f6() {
+  int b = 1;
+  return f5(2, &b, false);
+}
+
+// CHECK-LABEL: cir.func @f6() -> !s32i
+// CHECK:         %[[#b:]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["b", init]
+// CHECK:         %[[#a:]] = cir.const #cir.int<2> : !s32i
+// CHECK-NEXT:    %[[#c:]] = cir.const #false
+// CHECK-NEXT:    %5 = cir.call @f5(%[[#a]], %[[#b:]], %[[#c]]) : (!s32i, !cir.ptr<!s32i>, !cir.bool) -> !s32i
----------------
andykaylor wrote:

No, if that's not implemented yet, it's fine to leave these tests until it is. It would be good to add the lowering as soon as this PR is finished.

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


More information about the cfe-commits mailing list