[clang] [CIR] Cast alloca for function parameter to the right address space (PR #220836)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 01:22:03 PDT 2026


================
@@ -17,8 +17,9 @@ char4 f4(int x) {
 // CIR: cir.func {{.*}} @f4
 // CIR:   %[[X_ADDR:.*]] = cir.alloca "x" {{.*}} init : !cir.ptr<!s32i>
 // CIR:   %[[RET_ADDR:.*]] = cir.alloca "__retval" {{.*}} : !cir.ptr<!cir.vector<4 x !s8i>>
-// CIR:   cir.store %{{.*}}, %[[X_ADDR]] : !s32i, !cir.ptr<!s32i>
-// CIR:   %[[TMP_X:.*]] = cir.load {{.*}} %[[X_ADDR]] : !cir.ptr<!s32i>, !s32i
+// CIR:   %[[X_CAST:.*]] = cir.cast address_space %[[X_ADDR]] : !cir.ptr<!s32i> -> !cir.ptr<!s32i>
----------------
xlauko wrote:

why is no address space in pointer types here?

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


More information about the cfe-commits mailing list