diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td index 133858aa88a3..5b6f94b5ba7d 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td @@ -608,9 +608,9 @@ def DataMemberAttr : CIR_Attr<"DataMember", "data_member", Example: ``` - #ptr = #cir.data_member<1> : !cir.data_member + #ptr = #cir.data_member<1> : !cir.data_member - #null = #cir.data_member : !cir.data_member + #null = #cir.data_member : !cir.data_member ``` }]; diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td index 8f1771ff57b0..250c2b61f71b 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIROps.td +++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td @@ -2640,7 +2640,7 @@ def VTTAddrPointOp : CIR_Op<"vtt.address_point", ```mlir cir.global linkonce_odr @_ZTV1B = ... ... - %3 = cir.base_class_addr(%1 : !cir.ptr nonnull) [0] -> !cir.ptr + %3 = cir.base_class_addr(%1 : !cir.ptr nonnull) [0] -> !cir.ptr %4 = cir.vtt.address_point @_ZTT1D, offset = 1 -> !cir.ptr> cir.call @_ZN1BC2Ev(%3, %4) ``` @@ -3369,7 +3369,7 @@ def BaseClassAddrOp : CIR_Op<"base_class_addr"> { ``` will generate ```mlir - %3 = cir.base_class_addr (%1 : !cir.ptr nonnull) [0] -> !cir.ptr + %3 = cir.base_class_addr (%1 : !cir.ptr nonnull) [0] -> !cir.ptr ``` }]; @@ -3420,9 +3420,9 @@ def DerivedClassAddrOp : CIR_Op<"derived_class_addr"> { leads to ```mlir - %2 = cir.load %0 : !cir.ptr>, !cir.ptr - %3 = cir.derived_class_addr(%2 : !cir.ptr nonnull) [4] -> !cir.ptr - %4 = cir.base_class_addr(%3 : !cir.ptr) [0] -> !cir.ptr + %2 = cir.load %0 : !cir.ptr>, !cir.ptr + %3 = cir.derived_class_addr(%2 : !cir.ptr nonnull) [4] -> !cir.ptr + %4 = cir.base_class_addr(%3 : !cir.ptr) [0] -> !cir.ptr cir.return %4 ``` }]; @@ -3519,7 +3519,7 @@ def BaseMethodOp : CIR_Op<"base_method", [Pure]> { Example: ```mlir - %1 = cir.base_method(%0 : !cir.method in !ty_Derived>) [16] -> !cir.method in !ty_Base> + %1 = cir.base_method(%0 : !cir.method in !rec_Derived>) [16] -> !cir.method in !rec_Base> ``` }]; @@ -3551,7 +3551,7 @@ def DerivedMethodOp : CIR_Op<"derived_method", [Pure]> { Example: ```mlir - %1 = cir.derived_method(%0 : !cir.method in !ty_Base>) [16] -> !cir.method in !ty_Derived> + %1 = cir.derived_method(%0 : !cir.method in !rec_Base>) [16] -> !cir.method in !rec_Derived> ``` }]; @@ -5190,8 +5190,8 @@ def CIR_InlineAsmOp : CIR_Op<"asm", [RecursiveMemoryEffects]> { ``` ```mlir - !ty_22anon2E022 = !cir.record, !cir.int}> - !ty_22anon2E122 = !cir.record, !cir.int}> + !rec_22anon2E022 = !cir.record, !cir.int}> + !rec_22anon2E122 = !cir.record, !cir.int}> ... %0 = cir.alloca !s32i, !cir.ptr, ["x", init] %1 = cir.alloca !s32i, !cir.ptr, ["y", init] @@ -5209,13 +5209,13 @@ def CIR_InlineAsmOp : CIR_Op<"asm", [RecursiveMemoryEffects]> { out = [], in = [], in_out = [%2 : !s32i], - {"bar $$42 $0" "=r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) -> !ty_22anon2E022 + {"bar $$42 $0" "=r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) -> !rec_22anon2E022 cir.asm(x86_att, out = [], in = [%3 : !s32i], in_out = [%2 : !s32i], - {"baz $$42 $0" "=r,=&r,0,1,~{dirflag},~{fpsr},~{flags}"}) -> !ty_22anon2E122 + {"baz $$42 $0" "=r,=&r,0,1,~{dirflag},~{fpsr},~{flags}"}) -> !rec_22anon2E122 ``` }]; diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTBAAAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRTBAAAttrs.td index 02894d228912..4fd5ad5bec7b 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRTBAAAttrs.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRTBAAAttrs.td @@ -86,7 +86,7 @@ def CIR_TBAAMemberAttr : CIR_Attr<"TBAAMember", "tbaa_member", []> { Example: ```mlir - !ty_StructS = !cir.record + !rec_StructS = !cir.record #tbaa_scalar = #cir.tbaa_scalar #tbaa_scalar1 = #cir.tbaa_scalar #tbaa_struct = #cir.tbaa_struct, <#tbaa_scalar, 4>}> @@ -135,7 +135,7 @@ def CIR_TBAAStructAttr : CIR_Attr<"TBAAStruct", Example: ```mlir - !ty_StructS = !cir.record + !rec_StructS = !cir.record #tbaa_scalar = #cir.tbaa_scalar #tbaa_scalar1 = #cir.tbaa_scalar // CIR_TBAAStructAttr diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp index d157048c504b..d5b7235d1ca2 100644 --- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp +++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp @@ -63,9 +63,9 @@ struct CIROpAsmDialectInterface : public OpAsmDialectInterface { if (auto recordType = dyn_cast(type)) { StringAttr nameAttr = recordType.getName(); if (!nameAttr) - os << "ty_anon_" << recordType.getKindAsStr(); + os << "rec_anon_" << recordType.getKindAsStr(); else - os << "ty_" << nameAttr.getValue(); + os << "rec_" << nameAttr.getValue(); return AliasResult::OverridableAlias; } if (auto intType = dyn_cast(type)) { diff --git a/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c b/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c index e7e3d0218f3c..4cb9b6cfbf74 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c +++ b/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c @@ -29,8 +29,8 @@ typedef struct { } GT_128; // CHECK: cir.func {{.*@ret_lt_64}}() -> !u16i -// CHECK: %[[#V0:]] = cir.alloca !ty_LT_64, !cir.ptr, ["__retval"] -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_LT_64, !cir.ptr, ["__retval"] +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V2:]] = cir.load %[[#V1]] : !cir.ptr, !u16i // CHECK: cir.return %[[#V2]] : !u16i LT_64 ret_lt_64() { @@ -39,8 +39,8 @@ LT_64 ret_lt_64() { } // CHECK: cir.func {{.*@ret_eq_64}}() -> !u64i -// CHECK: %[[#V0:]] = cir.alloca !ty_EQ_64, !cir.ptr, ["__retval"] -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_EQ_64, !cir.ptr, ["__retval"] +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V2:]] = cir.load %[[#V1]] : !cir.ptr, !u64i // CHECK: cir.return %[[#V2]] : !u64i EQ_64 ret_eq_64() { @@ -49,8 +49,8 @@ EQ_64 ret_eq_64() { } // CHECK: cir.func {{.*@ret_lt_128}}() -> !cir.array -// CHECK: %[[#V0:]] = cir.alloca !ty_LT_128, !cir.ptr, ["__retval"] -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> +// CHECK: %[[#V0:]] = cir.alloca !rec_LT_128, !cir.ptr, ["__retval"] +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> // CHECK: %[[#V2:]] = cir.load %[[#V1]] : !cir.ptr>, !cir.array // CHECK: cir.return %[[#V2]] : !cir.array LT_128 ret_lt_128() { @@ -59,8 +59,8 @@ LT_128 ret_lt_128() { } // CHECK: cir.func {{.*@ret_eq_128}}() -> !cir.array -// CHECK: %[[#V0:]] = cir.alloca !ty_EQ_128, !cir.ptr, ["__retval"] -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> +// CHECK: %[[#V0:]] = cir.alloca !rec_EQ_128, !cir.ptr, ["__retval"] +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> // CHECK: %[[#V2:]] = cir.load %[[#V1]] : !cir.ptr>, !cir.array // CHECK: cir.return %[[#V2]] : !cir.array EQ_128 ret_eq_128() { @@ -68,7 +68,7 @@ EQ_128 ret_eq_128() { return x; } -// CHECK: cir.func {{.*@ret_gt_128}}(%arg0: !cir.ptr +// CHECK: cir.func {{.*@ret_gt_128}}(%arg0: !cir.ptr // CHECK-NOT: cir.return {{%.*}} GT_128 ret_gt_128() { GT_128 x; @@ -82,9 +82,9 @@ typedef struct { } S; // CHECK: cir.func {{.*@retS}}() -> !cir.array -// CHECK: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.alloca !cir.array, !cir.ptr>, ["tmp"] {alignment = 8 : i64} -// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr>), !cir.ptr // CHECK: %[[#V4:]] = cir.const #cir.int<12> : !u64i // CHECK: cir.libc.memcpy %[[#V4]] bytes from %[[#V2]] to %[[#V3]] : !u64i, !cir.ptr -> !cir.ptr @@ -102,9 +102,9 @@ S retS() { return s; } // CHECK: cir.func {{.*@pass_lt_64}}(%arg0: !u64 -// CHECK: %[[#V0:]] = cir.alloca !ty_LT_64, !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_LT_64, !cir.ptr // CHECK: %[[#V1:]] = cir.cast(integral, %arg0 : !u64i), !u16i -// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: cir.store %[[#V1]], %[[#V2]] : !u16i, !cir.ptr // LLVM: void @pass_lt_64(i64 %0) @@ -114,8 +114,8 @@ S retS() { void pass_lt_64(LT_64 s) {} // CHECK: cir.func {{.*@pass_eq_64}}(%arg0: !u64i -// CHECK: %[[#V0:]] = cir.alloca !ty_EQ_64, !cir.ptr -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_EQ_64, !cir.ptr +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: cir.store %arg0, %[[#V1]] : !u64i, !cir.ptr // LLVM: void @pass_eq_64(i64 %0) @@ -124,8 +124,8 @@ void pass_lt_64(LT_64 s) {} void pass_eq_64(EQ_64 s) {} // CHECK: cir.func {{.*@pass_lt_128}}(%arg0: !cir.array -// CHECK: %[[#V0:]] = cir.alloca !ty_LT_128, !cir.ptr -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> +// CHECK: %[[#V0:]] = cir.alloca !rec_LT_128, !cir.ptr +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> // CHECK: cir.store %arg0, %[[#V1]] : !cir.array, !cir.ptr> // LLVM: void @pass_lt_128([2 x i64] %0) @@ -134,8 +134,8 @@ void pass_eq_64(EQ_64 s) {} void pass_lt_128(LT_128 s) {} // CHECK: cir.func {{.*@pass_eq_128}}(%arg0: !cir.array -// CHECK: %[[#V0:]] = cir.alloca !ty_EQ_128, !cir.ptr -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> +// CHECK: %[[#V0:]] = cir.alloca !rec_EQ_128, !cir.ptr +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr> // CHECK: cir.store %arg0, %[[#V1]] : !cir.array, !cir.ptr> // LLVM: void @pass_eq_128([2 x i64] %0) @@ -143,10 +143,10 @@ void pass_lt_128(LT_128 s) {} // LLVM: store [2 x i64] %0, ptr %[[#V1]], align 8 void pass_eq_128(EQ_128 s) {} -// CHECK: cir.func @pass_gt_128(%arg0: !cir.ptr -// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %[[#V0]] : !cir.ptr, !cir.ptr> -// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr>, !cir.ptr +// CHECK: cir.func @pass_gt_128(%arg0: !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %[[#V0]] : !cir.ptr, !cir.ptr> +// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr>, !cir.ptr // LLVM: void @pass_gt_128(ptr %0) // LLVM: %[[#V1:]] = alloca ptr, i64 1, align 8 @@ -154,11 +154,11 @@ void pass_eq_128(EQ_128 s) {} // LLVM: %[[#V2:]] = load ptr, ptr %[[#V1]], align 8 void pass_gt_128(GT_128 s) {} -// CHECK: cir.func @get_gt_128(%arg0: !cir.ptr {{.*}}, %arg1: !cir.ptr -// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} -// CHECK: cir.store %arg1, %[[#V0]] : !cir.ptr, !cir.ptr> -// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr>, !cir.ptr -// CHECK: cir.copy %[[#V1]] to %arg0 : !cir.ptr +// CHECK: cir.func @get_gt_128(%arg0: !cir.ptr {{.*}}, %arg1: !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} +// CHECK: cir.store %arg1, %[[#V0]] : !cir.ptr, !cir.ptr> +// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr>, !cir.ptr +// CHECK: cir.copy %[[#V1]] to %arg0 : !cir.ptr // CHECK: cir.return // LLVM: void @get_gt_128(ptr %[[#V0:]], ptr %[[#V1:]]) @@ -171,16 +171,16 @@ GT_128 get_gt_128(GT_128 s) { return s; } -// CHECK: cir.func no_proto @call_and_get_gt_128(%arg0: !cir.ptr -// CHECK: %[[#V0:]] = cir.alloca !ty_GT_128, !cir.ptr, ["tmp"] {alignment = 8 : i64} -// CHECK: %[[#V1:]] = cir.load %arg0 : !cir.ptr, !ty_GT_128 -// CHECK: %[[#V2:]] = cir.alloca !ty_GT_128, !cir.ptr, [""] {alignment = 8 : i64} -// CHECK: %[[#V3:]] = cir.alloca !ty_GT_128, !cir.ptr, ["tmp"] {alignment = 8 : i64} -// CHECK: %[[#V4:]] = cir.cast(bitcast, %arg0 : !cir.ptr), !cir.ptr -// CHECK: %[[#V5:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr), !cir.ptr +// CHECK: cir.func no_proto @call_and_get_gt_128(%arg0: !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_GT_128, !cir.ptr, ["tmp"] {alignment = 8 : i64} +// CHECK: %[[#V1:]] = cir.load %arg0 : !cir.ptr, !rec_GT_128 +// CHECK: %[[#V2:]] = cir.alloca !rec_GT_128, !cir.ptr, [""] {alignment = 8 : i64} +// CHECK: %[[#V3:]] = cir.alloca !rec_GT_128, !cir.ptr, ["tmp"] {alignment = 8 : i64} +// CHECK: %[[#V4:]] = cir.cast(bitcast, %arg0 : !cir.ptr), !cir.ptr +// CHECK: %[[#V5:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr), !cir.ptr // CHECK: %[[#V6:]] = cir.const #cir.int<24> : !u64i // CHECK: cir.libc.memcpy %[[#V6]] bytes from %[[#V4]] to %[[#V5]] : !u64i, !cir.ptr -> !cir.ptr -// CHECK: cir.call @get_gt_128(%[[#V2]], %[[#V3]]) : (!cir.ptr, !cir.ptr) -> () +// CHECK: cir.call @get_gt_128(%[[#V2]], %[[#V3]]) : (!cir.ptr, !cir.ptr) -> () // CHECK: cir.return // LLVM: void @call_and_get_gt_128(ptr %[[#V0:]]) @@ -196,11 +196,11 @@ GT_128 call_and_get_gt_128() { return s; } // CHECK: cir.func @passS(%arg0: !cir.array -// CHECK: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, [""] {alignment = 4 : i64} +// CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.alloca !cir.array, !cir.ptr>, ["tmp"] {alignment = 8 : i64} // CHECK: cir.store %arg0, %[[#V1]] : !cir.array, !cir.ptr> // CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr>), !cir.ptr -// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V4:]] = cir.const #cir.int<12> : !u64i // CHECK: cir.libc.memcpy %[[#V4]] bytes from %[[#V2]] to %[[#V3]] : !u64i, !cir.ptr -> !cir.ptr @@ -212,10 +212,10 @@ GT_128 call_and_get_gt_128() { void passS(S s) {} // CHECK: @callS() -// CHECK: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, ["s"] {alignment = 4 : i64} +// CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, ["s"] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.alloca !cir.array, !cir.ptr>, ["tmp"] {alignment = 8 : i64} -// CHECK: %[[#V2:]] = cir.load %[[#V0]] : !cir.ptr, !ty_S -// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V2:]] = cir.load %[[#V0]] : !cir.ptr, !rec_S +// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr>), !cir.ptr // CHECK: %[[#V5:]] = cir.const #cir.int<12> : !u64i // CHECK: cir.libc.memcpy %[[#V5]] bytes from %[[#V3]] to %[[#V4]] : !u64i, !cir.ptr -> !cir.ptr @@ -243,10 +243,10 @@ typedef struct { } S_PAD; // CHECK: cir.func {{.*@ret_s_pad}}() -> !u48i -// CHECK: %[[#V0:]] = cir.alloca !ty_S_PAD, !cir.ptr, ["__retval"] {alignment = 2 : i64} -// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr, !ty_S_PAD +// CHECK: %[[#V0:]] = cir.alloca !rec_S_PAD, !cir.ptr, ["__retval"] {alignment = 2 : i64} +// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr, !rec_S_PAD // CHECK: %[[#V2:]] = cir.alloca !u48i, !cir.ptr, [""] {alignment = 2 : i64} -// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr) +// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr) // CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V2:]] : !cir.ptr), !cir.ptr // CHECK: %[[#V5:]] = cir.const #cir.int<6> : !u64i // CHECK: cir.libc.memcpy %[[#V5]] bytes from %[[#V3]] to %[[#V4]] : !u64i, !cir.ptr @@ -269,10 +269,10 @@ typedef struct { int a[42]; } CAT; -// CHECK: cir.func @pass_cat(%arg0: !cir.ptr -// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %[[#V0]] : !cir.ptr, !cir.ptr> -// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr>, !cir.ptr +// CHECK: cir.func @pass_cat(%arg0: !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %[[#V0]] : !cir.ptr, !cir.ptr> +// CHECK: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr>, !cir.ptr // CHECK: cir.return // LLVM: void @pass_cat(ptr %[[#V0:]]) @@ -292,9 +292,9 @@ typedef struct { } NESTED_U; // CHECK: cir.func @pass_nested_u(%arg0: !u64i -// CHECK: %[[#V0:]] = cir.alloca !ty_NESTED_U, !cir.ptr, [""] {alignment = 4 : i64} +// CHECK: %[[#V0:]] = cir.alloca !rec_NESTED_U, !cir.ptr, [""] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.cast(integral, %arg0 : !u64i), !u16i -// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr +// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr // CHECK: cir.store %[[#V1]], %[[#V2]] : !u16i // CHECK: cir.return @@ -306,14 +306,14 @@ typedef struct { void pass_nested_u(NESTED_U a) {} // CHECK: cir.func no_proto @call_nested_u() -// CHECK: %[[#V0:]] = cir.alloca !ty_NESTED_U, !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_NESTED_U, !cir.ptr // CHECK: %[[#V1:]] = cir.alloca !u64i, !cir.ptr, ["tmp"] -// CHECK: %[[#V2:]] = cir.load %[[#V0]] : !cir.ptr, !ty_NESTED_U -// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr -// CHECK: %[[#V4:]] = cir.load %[[#V3]] : !cir.ptr, !ty_anon2E0 -// CHECK: %[[#V5:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr), !cir.ptr -// CHECK: %[[#V6:]] = cir.load %[[#V5]] : !cir.ptr, !ty_anon2E1 -// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V5]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V2:]] = cir.load %[[#V0]] : !cir.ptr, !rec_NESTED_U +// CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V4:]] = cir.load %[[#V3]] : !cir.ptr, !rec_anon2E0 +// CHECK: %[[#V5:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V6:]] = cir.load %[[#V5]] : !cir.ptr, !rec_anon2E1 +// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V5]] : !cir.ptr), !cir.ptr // CHECK: %[[#V8:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr), !cir.ptr // CHECK: %[[#V9:]] = cir.const #cir.int<2> : !u64i // CHECK: cir.libc.memcpy %[[#V9]] bytes from %[[#V7]] to %[[#V8]] : !u64i, !cir.ptr -> !cir.ptr @@ -357,12 +357,12 @@ void bar(void) { } // CHECK: cir.func @bar -// CHECK: %[[#V0:]] = cir.alloca !ty_PackedS1, !cir.ptr, ["y", init] +// CHECK: %[[#V0:]] = cir.alloca !rec_PackedS1, !cir.ptr, ["y", init] // CHECK: %[[#V1:]] = cir.alloca !cir.array, !cir.ptr>, ["tmp"] // CHECK: %[[#V2:]] = cir.call @foo() : () -> !cir.array // CHECK: cir.store %[[#V2]], %[[#V1]] : !cir.array, !cir.ptr> // CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr>), !cir.ptr -// CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V5:]] = cir.const #cir.int<14> : !u64i // CHECK: cir.libc.memcpy %[[#V5]] bytes from %[[#V3]] to %[[#V4]] : !u64i, !cir.ptr -> !cir.ptr @@ -396,15 +396,15 @@ void qux(void) { // check source of memcpy // CHECK: cir.func @qux -// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, ["s1", init] +// CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, ["s1", init] // CHECK: %[[#V1:]] = cir.alloca !u64i, !cir.ptr, ["tmp"] -// CHECK: %[[#V2:]] = cir.get_global @g : !cir.ptr> +// CHECK: %[[#V2:]] = cir.get_global @g : !cir.ptr> // CHECK: %[[#V3:]] = cir.const #cir.int<1> : !s32i -// CHECK: %[[#V4:]] = cir.cast(array_to_ptrdecay, %[[#V2]] : !cir.ptr>), !cir.ptr -// CHECK: %[[#V5:]] = cir.ptr_stride(%[[#V4]] : !cir.ptr, %[[#V3]] : !s32i), !cir.ptr -// CHECK: cir.store %[[#V5]], %[[#V0]] : !cir.ptr, !cir.ptr> -// CHECK: %[[#V6:]] = cir.load deref %[[#V0]] : !cir.ptr>, !cir.ptr -// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V6]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V4:]] = cir.cast(array_to_ptrdecay, %[[#V2]] : !cir.ptr>), !cir.ptr +// CHECK: %[[#V5:]] = cir.ptr_stride(%[[#V4]] : !cir.ptr, %[[#V3]] : !s32i), !cir.ptr +// CHECK: cir.store %[[#V5]], %[[#V0]] : !cir.ptr, !cir.ptr> +// CHECK: %[[#V6:]] = cir.load deref %[[#V0]] : !cir.ptr>, !cir.ptr +// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V6]] : !cir.ptr), !cir.ptr // CHECK: %[[#V8:]] = cir.const #cir.int<6> : !u64i // CHECK: cir.libc.memcpy %[[#V8]] bytes from %[[#V7]] diff --git a/clang/test/CIR/CallConvLowering/AArch64/aarch64_be-cc-structs.c b/clang/test/CIR/CallConvLowering/AArch64/aarch64_be-cc-structs.c index 226f415572a8..31fcdaf8d709 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/aarch64_be-cc-structs.c +++ b/clang/test/CIR/CallConvLowering/AArch64/aarch64_be-cc-structs.c @@ -7,8 +7,8 @@ typedef struct { } __attribute__((alligned (4))) S; // CHECK: cir.func {{.*@init}}() -> !u64i -// CHECK: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V2:]] = cir.load %[[#V1]] : !cir.ptr, !u64i // CHECK: cir.return %[[#V2]] : !u64i S init() { diff --git a/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c b/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c index 19ce3cd22a4a..09d5f991302b 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c +++ b/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c @@ -12,11 +12,11 @@ typedef struct { int foo(int x) { return x; } // CIR: cir.func @passA(%arg0: !u64i -// CIR: %[[#V0:]] = cir.alloca !ty_A, !cir.ptr, [""] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_A, !cir.ptr, [""] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store %arg0, %[[#V1]] : !u64i, !cir.ptr // CIR: %[[#V2:]] = cir.get_global @foo : !cir.ptr !s32i>> -// CIR: %[[#V3:]] = cir.get_member %[[#V0]][0] {name = "f"} : !cir.ptr -> !cir.ptr !s32i>>> +// CIR: %[[#V3:]] = cir.get_member %[[#V0]][0] {name = "f"} : !cir.ptr -> !cir.ptr !s32i>>> // CIR: cir.store %[[#V2]], %[[#V3]] : !cir.ptr !s32i>>, !cir.ptr !s32i>>> // CIR: cir.return @@ -37,8 +37,8 @@ typedef struct { } S_2; // CIR: cir.func @passB(%arg0: !u64i -// CIR: %[[#V0:]] = cir.alloca !ty_S_2, !cir.ptr, [""] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_S_2, !cir.ptr, [""] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store %arg0, %[[#V1]] : !u64i, !cir.ptr // CIR: cir.return diff --git a/clang/test/CIR/CallConvLowering/AArch64/struct.c b/clang/test/CIR/CallConvLowering/AArch64/struct.c index 2100d02ec43b..41b06fec1c31 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/struct.c +++ b/clang/test/CIR/CallConvLowering/AArch64/struct.c @@ -8,18 +8,18 @@ typedef struct { } S; // CIR: cir.func @init(%arg0: !u64i -// CIR: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, [""] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store %arg0, %[[#V1]] : !u64i, !cir.ptr -// CIR: %[[#V2:]] = cir.alloca !ty_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CIR: %[[#V2:]] = cir.alloca !rec_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR: %[[#V3:]] = cir.const #cir.int<1> : !s32i -// CIR: %[[#V4:]] = cir.get_member %[[#V0]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CIR: %[[#V4:]] = cir.get_member %[[#V0]][0] {name = "a"} : !cir.ptr -> !cir.ptr // CIR: cir.store %[[#V3]], %[[#V4]] : !s32i, !cir.ptr // CIR: %[[#V5:]] = cir.const #cir.int<2> : !s32i -// CIR: %[[#V6:]] = cir.get_member %[[#V0]][1] {name = "b"} : !cir.ptr -> !cir.ptr +// CIR: %[[#V6:]] = cir.get_member %[[#V0]][1] {name = "b"} : !cir.ptr -> !cir.ptr // CIR: cir.store %[[#V5]], %[[#V6]] : !s32i, !cir.ptr -// CIR: cir.copy %[[#V0]] to %[[#V2]] : !cir.ptr -// CIR: %[[#V7:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr +// CIR: cir.copy %[[#V0]] to %[[#V2]] : !cir.ptr +// CIR: %[[#V7:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr // CIR: %[[#V8:]] = cir.load %[[#V7]] : !cir.ptr, !u64i // CIR: cir.return %[[#V8]] : !u64i @@ -41,14 +41,14 @@ S init(S s) { } // CIR: cir.func no_proto @foo1 -// CIR: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, ["s"] -// CIR: %[[#V1:]] = cir.alloca !ty_S, !cir.ptr, ["tmp"] {alignment = 4 : i64} -// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, ["s"] +// CIR: %[[#V1:]] = cir.alloca !rec_S, !cir.ptr, ["tmp"] {alignment = 4 : i64} +// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: %[[#V3:]] = cir.load %[[#V2]] : !cir.ptr, !u64i // CIR: %[[#V4:]] = cir.call @init(%[[#V3]]) : (!u64i) -> !u64i -// CIR: %[[#V5:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr), !cir.ptr +// CIR: %[[#V5:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr), !cir.ptr // CIR: cir.store %[[#V4]], %[[#V5]] : !u64i, !cir.ptr -// CIR: cir.copy %[[#V1]] to %[[#V0]] : !cir.ptr +// CIR: cir.copy %[[#V1]] to %[[#V0]] : !cir.ptr // CIR: cir.return // LLVM: @foo1() @@ -64,22 +64,22 @@ void foo1() { } // CIR: cir.func @foo2(%arg0: !u64i -// CIR: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, [""] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store %arg0, %[[#V1]] : !u64i, !cir.ptr -// CIR: %[[#V2:]] = cir.alloca !ty_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CIR: %[[#V3:]] = cir.alloca !ty_S, !cir.ptr, ["s2"] -// CIR: %[[#V4:]] = cir.alloca !ty_S, !cir.ptr, ["tmp"] {alignment = 4 : i64} -// CIR: %[[#V5:]] = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i}> : !ty_S -// CIR: cir.store %[[#V5]], %[[#V3]] : !ty_S, !cir.ptr -// CIR: %[[#V6:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V2:]] = cir.alloca !rec_S, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CIR: %[[#V3:]] = cir.alloca !rec_S, !cir.ptr, ["s2"] +// CIR: %[[#V4:]] = cir.alloca !rec_S, !cir.ptr, ["tmp"] {alignment = 4 : i64} +// CIR: %[[#V5:]] = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i}> : !rec_S +// CIR: cir.store %[[#V5]], %[[#V3]] : !rec_S, !cir.ptr +// CIR: %[[#V6:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: %[[#V7:]] = cir.load %[[#V6]] : !cir.ptr, !u64i // CIR: %[[#V8:]] = cir.call @foo2(%[[#V7]]) : (!u64i) -> !u64i -// CIR: %[[#V9:]] = cir.cast(bitcast, %[[#V4]] : !cir.ptr), !cir.ptr +// CIR: %[[#V9:]] = cir.cast(bitcast, %[[#V4]] : !cir.ptr), !cir.ptr // CIR: cir.store %[[#V8]], %[[#V9]] : !u64i, !cir.ptr -// CIR: cir.copy %[[#V4]] to %[[#V0]] : !cir.ptr -// CIR: cir.copy %[[#V0]] to %[[#V2]] : !cir.ptr -// CIR: %[[#V10:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr +// CIR: cir.copy %[[#V4]] to %[[#V0]] : !cir.ptr +// CIR: cir.copy %[[#V0]] to %[[#V2]] : !cir.ptr +// CIR: %[[#V10:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr // CIR: %[[#V11:]] = cir.load %[[#V10]] : !cir.ptr, !u64i // CIR: cir.return %[[#V11]] : !u64i @@ -109,20 +109,20 @@ typedef struct { } S2; // CIR: cir.func @init2(%arg0: !u16i -// CIR: %[[#V0:]] = cir.alloca !ty_S2, !cir.ptr, [""] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_S2, !cir.ptr, [""] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store %arg0, %[[#V1]] : !u16i, !cir.ptr -// CIR: %[[#V2:]] = cir.alloca !ty_S2, !cir.ptr, ["__retval"] {alignment = 1 : i64} +// CIR: %[[#V2:]] = cir.alloca !rec_S2, !cir.ptr, ["__retval"] {alignment = 1 : i64} // CIR: %[[#V3:]] = cir.const #cir.int<1> : !s32i // CIR: %[[#V4:]] = cir.cast(integral, %[[#V3]] : !s32i), !s8i -// CIR: %[[#V5:]] = cir.get_member %[[#V0]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CIR: %[[#V5:]] = cir.get_member %[[#V0]][0] {name = "a"} : !cir.ptr -> !cir.ptr // CIR: cir.store %[[#V4]], %[[#V5]] : !s8i, !cir.ptr // CIR: %[[#V6:]] = cir.const #cir.int<2> : !s32i // CIR: %[[#V7:]] = cir.cast(integral, %[[#V6]] : !s32i), !s8i -// CIR: %[[#V8:]] = cir.get_member %[[#V0]][1] {name = "b"} : !cir.ptr -> !cir.ptr +// CIR: %[[#V8:]] = cir.get_member %[[#V0]][1] {name = "b"} : !cir.ptr -> !cir.ptr // CIR: cir.store %[[#V7]], %[[#V8]] : !s8i, !cir.ptr -// CIR: cir.copy %[[#V0]] to %[[#V2]] : !cir.ptr -// CIR: %[[#V9:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr +// CIR: cir.copy %[[#V0]] to %[[#V2]] : !cir.ptr +// CIR: %[[#V9:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr // CIR: %[[#V10:]] = cir.load %[[#V9]] : !cir.ptr, !u16i // CIR: cir.return %[[#V10]] : !u16i @@ -144,14 +144,14 @@ S2 init2(S2 s) { } // CIR: cir.func no_proto @foo3() -// CIR: %[[#V0:]] = cir.alloca !ty_S2, !cir.ptr, ["s"] -// CIR: %[[#V1:]] = cir.alloca !ty_S2, !cir.ptr, ["tmp"] {alignment = 1 : i64} -// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_S2, !cir.ptr, ["s"] +// CIR: %[[#V1:]] = cir.alloca !rec_S2, !cir.ptr, ["tmp"] {alignment = 1 : i64} +// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: %[[#V3:]] = cir.load %[[#V2]] : !cir.ptr, !u16i // CIR: %[[#V4:]] = cir.call @init2(%[[#V3]]) : (!u16i) -> !u16i -// CIR: %[[#V5:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr), !cir.ptr +// CIR: %[[#V5:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr), !cir.ptr // CIR: cir.store %[[#V4]], %[[#V5]] : !u16i, !cir.ptr -// CIR: cir.copy %[[#V1]] to %[[#V0]] : !cir.ptr +// CIR: cir.copy %[[#V1]] to %[[#V0]] : !cir.ptr // CIR: cir.return // LLVM: @foo3() diff --git a/clang/test/CIR/CallConvLowering/AArch64/union.c b/clang/test/CIR/CallConvLowering/AArch64/union.c index 857061b3804a..2dc27a2a9333 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/union.c +++ b/clang/test/CIR/CallConvLowering/AArch64/union.c @@ -3,16 +3,16 @@ // RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t.ll -fclangir-call-conv-lowering // RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM -// CIR: !ty_U = !cir.record +// CIR: !rec_U = !cir.record // LLVM: %union.U = type { i32 } typedef union { int a, b, c; } U; // CIR: cir.func @foo(%arg0: !u64i -// CIR: %[[#V0:]] = cir.alloca !ty_U, !cir.ptr, [""] {alignment = 4 : i64} +// CIR: %[[#V0:]] = cir.alloca !rec_U, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(integral, %arg0 : !u64i), !u32i -// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store %[[#V1]], %[[#V2]] : !u32i, !cir.ptr // CIR: cir.return @@ -24,9 +24,9 @@ typedef union { void foo(U u) {} // CIR: cir.func no_proto @init() -> !u32i -// CIR: %[[#V0:]] = cir.alloca !ty_U, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr, !ty_U -// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_U, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr, !rec_U +// CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: %[[#V3:]] = cir.load %[[#V2]] : !cir.ptr, !u32i // CIR: cir.return %[[#V3]] : !u32i @@ -54,8 +54,8 @@ typedef union { void passA(A x) {} // CIR: cir.func {{.*@callA}}() -// CIR: %[[#V0:]] = cir.alloca !ty_A, !cir.ptr, ["x"] {alignment = 4 : i64} -// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0:]] : !cir.ptr), !cir.ptr +// CIR: %[[#V0:]] = cir.alloca !rec_A, !cir.ptr, ["x"] {alignment = 4 : i64} +// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0:]] : !cir.ptr), !cir.ptr // CIR: %[[#V2:]] = cir.load %[[#V1]] : !cir.ptr, !s32i // CIR: %[[#V3:]] = cir.cast(integral, %[[#V2]] : !s32i), !u64i // CIR: cir.call @passA(%[[#V3]]) : (!u64i) -> () diff --git a/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp b/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp index 38c2075a3668..1e7576c1a15b 100644 --- a/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp +++ b/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp @@ -84,7 +84,7 @@ struct Struct { int a, b, c, d, e; }; -// CHECK: cir.func @_Z10StructFuncv() -> !ty_Struct +// CHECK: cir.func @_Z10StructFuncv() -> !rec_Struct Struct StructFunc() { return { 0, 1, 2, 3, 4 }; } diff --git a/clang/test/CIR/CallConvLowering/x86_64/basic.cpp b/clang/test/CIR/CallConvLowering/x86_64/basic.cpp index e50f43b89ea5..34a4c327c2f3 100644 --- a/clang/test/CIR/CallConvLowering/x86_64/basic.cpp +++ b/clang/test/CIR/CallConvLowering/x86_64/basic.cpp @@ -99,29 +99,29 @@ struct S1 { /// Validate coerced argument and cast it to the expected type. /// Cast arguments to the expected type. -// CHECK: %[[#V0:]] = cir.alloca !ty_S1, !cir.ptr, [""] {alignment = 4 : i64} -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_S1, !cir.ptr, [""] {alignment = 4 : i64} +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: cir.store %arg0, %[[#V1]] : !u64i, !cir.ptr -// CHECK: %[[#V2:]] = cir.alloca !ty_S1, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: %[[#V3:]] = cir.alloca !ty_S1, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} -// CHECK: %[[#V4:]] = cir.alloca !ty_S1, !cir.ptr, ["agg.tmp1"] {alignment = 4 : i64} +// CHECK: %[[#V2:]] = cir.alloca !rec_S1, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CHECK: %[[#V3:]] = cir.alloca !rec_S1, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} +// CHECK: %[[#V4:]] = cir.alloca !rec_S1, !cir.ptr, ["agg.tmp1"] {alignment = 4 : i64} S1 s1(S1 arg) { /// Cast argument and result of the function call to the expected types. - // CHECK: %[[#V9:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr), !cir.ptr + // CHECK: %[[#V9:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr), !cir.ptr // CHECK: %[[#V10:]] = cir.load %[[#V9]] : !cir.ptr, !u64i // CHECK: %[[#V11:]] = cir.call @_Z2s12S1(%[[#V10]]) : (!u64i) -> !u64i - // CHECK: %[[#V12:]] = cir.cast(bitcast, %[[#V4]] : !cir.ptr), !cir.ptr + // CHECK: %[[#V12:]] = cir.cast(bitcast, %[[#V4]] : !cir.ptr), !cir.ptr // CHECK: cir.store %[[#V11]], %[[#V12]] : !u64i, !cir.ptr s1({1, 2}); - // CHECK: %[[#V13:]] = cir.get_member %[[#V2]][0] {name = "a"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#V13:]] = cir.get_member %[[#V2]][0] {name = "a"} : !cir.ptr -> !cir.ptr // CHECK: %[[#V14:]] = cir.const #cir.int<1> : !s32i // CHECK: cir.store %[[#V14]], %[[#V13]] : !s32i, !cir.ptr - // CHECK: %[[#V15:]] = cir.get_member %[[#V2]][1] {name = "b"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#V15:]] = cir.get_member %[[#V2]][1] {name = "b"} : !cir.ptr -> !cir.ptr // CHECK: %[[#V16:]] = cir.const #cir.int<2> : !s32i // CHECK: cir.store %[[#V16]], %[[#V15]] : !s32i, !cir.ptr - // CHECK: %[[#V17:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr + // CHECK: %[[#V17:]] = cir.cast(bitcast, %[[#V2]] : !cir.ptr), !cir.ptr // CHECK: %[[#V18:]] = cir.load %[[#V17]] : !cir.ptr, !u64i // CHECK: cir.return %[[#V18]] : !u64i return {1, 2}; @@ -135,60 +135,60 @@ struct S2 { // COM: Function prologue -// CHECK: cir.func @_Z2s22S2(%[[ARG0:[a-z0-9]+]]: !u64i {{.*}}, %[[ARG1:[a-z0-9]+]]: !s32i {{.*}}) -> !ty_anon_struct -// CHECK: %[[#F0:]] = cir.alloca !ty_S2, !cir.ptr -// CHECK: %[[#F1:]] = cir.alloca !ty_anon_struct, !cir.ptr -// CHECK: %[[#F2:]] = cir.get_member %[[#F1]][0]{{.*}} : !cir.ptr -> !cir.ptr +// CHECK: cir.func @_Z2s22S2(%[[ARG0:[a-z0-9]+]]: !u64i {{.*}}, %[[ARG1:[a-z0-9]+]]: !s32i {{.*}}) -> !rec_anon_struct +// CHECK: %[[#F0:]] = cir.alloca !rec_S2, !cir.ptr +// CHECK: %[[#F1:]] = cir.alloca !rec_anon_struct, !cir.ptr +// CHECK: %[[#F2:]] = cir.get_member %[[#F1]][0]{{.*}} : !cir.ptr -> !cir.ptr // CHECK: cir.store %[[ARG0]], %[[#F2]] : !u64i, !cir.ptr -// CHECK: %[[#F3:]] = cir.get_member %[[#F1]][1]{{.*}} : !cir.ptr -> !cir.ptr +// CHECK: %[[#F3:]] = cir.get_member %[[#F1]][1]{{.*}} : !cir.ptr -> !cir.ptr // CHECK: cir.store %[[ARG1]], %[[#F3]] : !s32i, !cir.ptr -// CHECK: %[[#F4:]] = cir.cast(bitcast, %[[#F1]] : !cir.ptr), !cir.ptr -// CHECK: %[[#F5:]] = cir.cast(bitcast, %[[#F0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#F4:]] = cir.cast(bitcast, %[[#F1]] : !cir.ptr), !cir.ptr +// CHECK: %[[#F5:]] = cir.cast(bitcast, %[[#F0]] : !cir.ptr), !cir.ptr // CHECK: %[[#F6:]] = cir.const #cir.int<12> : !u64i // CHECK: cir.libc.memcpy %[[#F6]] bytes from %[[#F4]] to %[[#F5]] S2 s2(S2 arg) { - // CHECK: %[[#F7:]] = cir.alloca !ty_S2, !cir.ptr, ["__retval"] {alignment = 4 : i64} - // CHECK: %[[#F8:]] = cir.alloca !ty_S2, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} - // CHECK: %[[#F9:]] = cir.alloca !ty_S2, !cir.ptr, ["agg.tmp1"] {alignment = 4 : i64} - // CHECK: %[[#F10:]] = cir.alloca !ty_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} - // CHECK: %[[#F11:]] = cir.alloca !ty_S2, !cir.ptr, ["tmp"] {alignment = 4 : i64} - // CHECK: %[[#F12:]] = cir.alloca !ty_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} - // CHECK: %[[#F13:]] = cir.alloca !ty_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} + // CHECK: %[[#F7:]] = cir.alloca !rec_S2, !cir.ptr, ["__retval"] {alignment = 4 : i64} + // CHECK: %[[#F8:]] = cir.alloca !rec_S2, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} + // CHECK: %[[#F9:]] = cir.alloca !rec_S2, !cir.ptr, ["agg.tmp1"] {alignment = 4 : i64} + // CHECK: %[[#F10:]] = cir.alloca !rec_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} + // CHECK: %[[#F11:]] = cir.alloca !rec_S2, !cir.ptr, ["tmp"] {alignment = 4 : i64} + // CHECK: %[[#F12:]] = cir.alloca !rec_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} + // CHECK: %[[#F13:]] = cir.alloca !rec_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} // COM: Construction of S2 { 1, 2, 3 }. - // CHECK: %[[#F14:]] = cir.get_member %[[#F8]][0] {{.*}} : !cir.ptr -> !cir.ptr + // CHECK: %[[#F14:]] = cir.get_member %[[#F8]][0] {{.*}} : !cir.ptr -> !cir.ptr // CHECK: %[[#F15:]] = cir.const #cir.int<1> : !s32i // CHECK: cir.store %[[#F15]], %[[#F14]] : !s32i, !cir.ptr - // CHECK: %[[#F16:]] = cir.get_member %[[#F8]][1] {{.*}} : !cir.ptr -> !cir.ptr + // CHECK: %[[#F16:]] = cir.get_member %[[#F8]][1] {{.*}} : !cir.ptr -> !cir.ptr // CHECK: %[[#F17:]] = cir.const #cir.int<2> : !s32i // CHECK: cir.store %[[#F17]], %[[#F16]] : !s32i, !cir.ptr - // CHECK: %[[#F18:]] = cir.get_member %[[#F8]][2] {{.*}} : !cir.ptr -> !cir.ptr + // CHECK: %[[#F18:]] = cir.get_member %[[#F8]][2] {{.*}} : !cir.ptr -> !cir.ptr // CHECK: %[[#F19:]] = cir.const #cir.int<3> : !s32i // CHECK: cir.store %[[#F19]], %[[#F18]] : !s32i, !cir.ptr // COM: Flattening of the struct. // COM: { i32, i32, i32 } -> { i64, i32 }. - // CHECK: %[[#F20:]] = cir.load %[[#F8]] : !cir.ptr, !ty_S2 - // CHECK: cir.store %[[#F20]], %[[#F11]] : !ty_S2, !cir.ptr - // CHECK: %[[#F21:]] = cir.cast(bitcast, %[[#F11]] : !cir.ptr), !cir.ptr - // CHECK: %[[#F22:]] = cir.cast(bitcast, %[[#F10]] : !cir.ptr), !cir.ptr + // CHECK: %[[#F20:]] = cir.load %[[#F8]] : !cir.ptr, !rec_S2 + // CHECK: cir.store %[[#F20]], %[[#F11]] : !rec_S2, !cir.ptr + // CHECK: %[[#F21:]] = cir.cast(bitcast, %[[#F11]] : !cir.ptr), !cir.ptr + // CHECK: %[[#F22:]] = cir.cast(bitcast, %[[#F10]] : !cir.ptr), !cir.ptr // CHECK: %[[#F23:]] = cir.const #cir.int<12> : !u64i // CHECK: cir.libc.memcpy %[[#F23]] bytes from %[[#F21]] to %[[#F22]] // COM: Function call. // COM: Retrieve the two values in { i64, i32 }. - // CHECK: %[[#F24:]] = cir.get_member %[[#F10]][0] {name = ""} : !cir.ptr -> !cir.ptr + // CHECK: %[[#F24:]] = cir.get_member %[[#F10]][0] {name = ""} : !cir.ptr -> !cir.ptr // CHECK: %[[#F25:]] = cir.load %[[#F24]] : !cir.ptr, !u64i - // CHECK: %[[#F26:]] = cir.get_member %[[#F10]][1] {name = ""} : !cir.ptr -> !cir.ptr + // CHECK: %[[#F26:]] = cir.get_member %[[#F10]][1] {name = ""} : !cir.ptr -> !cir.ptr // CHECK: %[[#F27:]] = cir.load %[[#F26]] : !cir.ptr, !s32i - // CHECK: %[[#F28:]] = cir.call @_Z2s22S2(%[[#F25]], %[[#F27]]) : (!u64i, !s32i) -> !ty_anon_struct - // CHECK: cir.store %[[#F28]], %[[#F12]] : !ty_anon_struct, !cir.ptr + // CHECK: %[[#F28:]] = cir.call @_Z2s22S2(%[[#F25]], %[[#F27]]) : (!u64i, !s32i) -> !rec_anon_struct + // CHECK: cir.store %[[#F28]], %[[#F12]] : !rec_anon_struct, !cir.ptr - // CHECK: %[[#F29:]] = cir.cast(bitcast, %[[#F12]] : !cir.ptr), !cir.ptr - // CHECK: %[[#F30:]] = cir.cast(bitcast, %[[#F9]] : !cir.ptr), !cir.ptr + // CHECK: %[[#F29:]] = cir.cast(bitcast, %[[#F12]] : !cir.ptr), !cir.ptr + // CHECK: %[[#F30:]] = cir.cast(bitcast, %[[#F9]] : !cir.ptr), !cir.ptr // CHECK: %[[#F31:]] = cir.const #cir.int<12> : !u64i // CHECK: cir.libc.memcpy %[[#F31]] bytes from %[[#F29]] to %[[#F30]] @@ -197,12 +197,12 @@ S2 s2(S2 arg) { // COM: For return, the first two fields of S2 is also coerced. - // CHECK: %[[#F39:]] = cir.cast(bitcast, %[[#F7]] : !cir.ptr), !cir.ptr - // CHECK: %[[#F40:]] = cir.cast(bitcast, %[[#F13]] : !cir.ptr), !cir.ptr + // CHECK: %[[#F39:]] = cir.cast(bitcast, %[[#F7]] : !cir.ptr), !cir.ptr + // CHECK: %[[#F40:]] = cir.cast(bitcast, %[[#F13]] : !cir.ptr), !cir.ptr // CHECK: %[[#F41:]] = cir.const #cir.int<12> : !u64i // cir.libc.memcpy %[[#F41]] bytes from %[[#F39]] to %[[#F40]] - // CHECK: %[[#F42:]] = cir.load %[[#F13]] : !cir.ptr, !ty_anon_struct - // cir.return %[[#F42]] : !ty_anon_struct + // CHECK: %[[#F42:]] = cir.load %[[#F13]] : !cir.ptr, !rec_anon_struct + // cir.return %[[#F42]] : !rec_anon_struct s2({ 1, 2, 3 }); return { 1, 2, 3 }; } diff --git a/clang/test/CIR/CallConvLowering/x86_64/fptrs.c b/clang/test/CIR/CallConvLowering/x86_64/fptrs.c index e7d15528da19..d2ca66ab7eed 100644 --- a/clang/test/CIR/CallConvLowering/x86_64/fptrs.c +++ b/clang/test/CIR/CallConvLowering/x86_64/fptrs.c @@ -10,26 +10,26 @@ typedef int (*myfptr)(S); int foo(S s) { return 42 + s.a; } // CHECK: cir.func {{.*@bar}} -// CHECK: %[[#V0:]] = cir.alloca !cir.ptr !s32i>>, !cir.ptr !s32i>>>, ["a", init] +// CHECK: %[[#V0:]] = cir.alloca !cir.ptr !s32i>>, !cir.ptr !s32i>>>, ["a", init] // CHECK: %[[#V1:]] = cir.get_global @foo : !cir.ptr !s32i>> -// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> -// CHECK: cir.store %[[#V2]], %[[#V0]] : !cir.ptr !s32i>>, !cir.ptr !s32i>>> +// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> +// CHECK: cir.store %[[#V2]], %[[#V0]] : !cir.ptr !s32i>>, !cir.ptr !s32i>>> void bar() { myfptr a = foo; } // CHECK: cir.func {{.*@baz}}(%arg0: !s32i -// CHECK: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr, [""] {alignment = 4 : i64} -// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} +// CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: cir.store %arg0, %[[#V1]] : !s32i, !cir.ptr -// CHECK: %[[#V2:]] = cir.alloca !cir.ptr !s32i>>, !cir.ptr !s32i>>>, ["a", init] +// CHECK: %[[#V2:]] = cir.alloca !cir.ptr !s32i>>, !cir.ptr !s32i>>>, ["a", init] // CHECK: %[[#V3:]] = cir.get_global @foo : !cir.ptr !s32i>> -// CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> -// CHECK: cir.store %[[#V4]], %[[#V2]] : !cir.ptr !s32i>>, !cir.ptr !s32i>>> -// CHECK: %[[#V5:]] = cir.load %[[#V2]] : !cir.ptr !s32i>>>, !cir.ptr !s32i>> -// CHECK: %[[#V6:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V3]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> +// CHECK: cir.store %[[#V4]], %[[#V2]] : !cir.ptr !s32i>>, !cir.ptr !s32i>>> +// CHECK: %[[#V5:]] = cir.load %[[#V2]] : !cir.ptr !s32i>>>, !cir.ptr !s32i>> +// CHECK: %[[#V6:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V7:]] = cir.load %[[#V6]] : !cir.ptr, !s32i -// CHECK: %[[#V8:]] = cir.cast(bitcast, %[[#V5]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> +// CHECK: %[[#V8:]] = cir.cast(bitcast, %[[#V5]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> // CHECK: %[[#V9:]] = cir.call %[[#V8]](%[[#V7]]) : (!cir.ptr !s32i>>, !s32i) -> !s32i // LLVM: define dso_local void @baz(i32 %0) diff --git a/clang/test/CIR/CodeGen/CUDA/printf.cu b/clang/test/CIR/CodeGen/CUDA/printf.cu index ef967fe2373c..a693b491e6c1 100644 --- a/clang/test/CIR/CodeGen/CUDA/printf.cu +++ b/clang/test/CIR/CodeGen/CUDA/printf.cu @@ -15,11 +15,11 @@ __device__ void printer() { } // CIR-DEVICE: cir.func @_Z7printerv() extra({{.*}}) { -// CIR-DEVICE: %[[#Packed:]] = cir.alloca !ty_anon_struct +// CIR-DEVICE: %[[#Packed:]] = cir.alloca !rec_anon_struct // CIR-DEVICE: %[[#Zero:]] = cir.const #cir.int<0> : !s32i loc(#loc5) // CIR-DEVICE: %[[#Field0:]] = cir.get_member %0[0] // CIR-DEVICE: cir.store align(4) %[[#Zero]], %[[#Field0]] -// CIR-DEVICE: %[[#Output:]] = cir.cast(bitcast, %[[#Packed]] : !cir.ptr) +// CIR-DEVICE: %[[#Output:]] = cir.cast(bitcast, %[[#Packed]] : !cir.ptr) // CIR-DEVICE: cir.call @vprintf(%{{.+}}, %[[#Output]]) // CIR-DEVICE: cir.return // CIR-DEVICE: } diff --git a/clang/test/CIR/CodeGen/String.cpp b/clang/test/CIR/CodeGen/String.cpp index 5898eb09fbb6..c0f8973623a8 100644 --- a/clang/test/CIR/CodeGen/String.cpp +++ b/clang/test/CIR/CodeGen/String.cpp @@ -18,20 +18,20 @@ void test() { } // CHECK: cir.func linkonce_odr @_ZN6StringC2Ev -// CHECK-NEXT: %0 = cir.alloca !cir.ptr +// CHECK-NEXT: %0 = cir.alloca !cir.ptr // CHECK-NEXT: cir.store %arg0, %0 // CHECK-NEXT: %1 = cir.load %0 // CHECK-NEXT: %2 = cir.get_member %1[0] {name = "storage"} // CHECK-NEXT: %3 = cir.const #cir.ptr : !cir.ptr // CHECK-NEXT: cir.store %3, %2 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %4 = cir.get_member %1[1] {name = "size"} : !cir.ptr -> !cir.ptr +// CHECK-NEXT: %4 = cir.get_member %1[1] {name = "size"} : !cir.ptr -> !cir.ptr // CHECK-NEXT: %5 = cir.const #cir.int<0> : !s32i // CHECK-NEXT: %6 = cir.cast(integral, %5 : !s32i), !s64i // CHECK-NEXT: cir.store %6, %4 : !s64i, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } // CHECK: cir.func linkonce_odr @_ZN6StringC2Ei -// CHECK-NEXT: %0 = cir.alloca !cir.ptr +// CHECK-NEXT: %0 = cir.alloca !cir.ptr // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["size", init] // CHECK-NEXT: cir.store %arg0, %0 // CHECK-NEXT: cir.store %arg1, %1 @@ -39,7 +39,7 @@ void test() { // CHECK-NEXT: %3 = cir.get_member %2[0] {name = "storage"} // CHECK-NEXT: %4 = cir.const #cir.ptr : !cir.ptr // CHECK-NEXT: cir.store %4, %3 -// CHECK-NEXT: %5 = cir.get_member %2[1] {name = "size"} : !cir.ptr -> !cir.ptr +// CHECK-NEXT: %5 = cir.get_member %2[1] {name = "size"} : !cir.ptr -> !cir.ptr // CHECK-NEXT: %6 = cir.load %1 : !cir.ptr, !s32i // CHECK-NEXT: %7 = cir.cast(integral, %6 : !s32i), !s64i // CHECK-NEXT: cir.store %7, %5 : !s64i, !cir.ptr @@ -47,27 +47,27 @@ void test() { // CHECK-NEXT: } // CHECK: cir.func linkonce_odr @_ZN6StringC2EPKc -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK-NEXT: %3 = cir.get_member %2[0] {name = "storage"} : !cir.ptr -> !cir.ptr> +// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: %3 = cir.get_member %2[0] {name = "storage"} : !cir.ptr -> !cir.ptr> // CHECK-NEXT: %4 = cir.const #cir.ptr : !cir.ptr // CHECK-NEXT: cir.store %4, %3 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.return // CHECK: cir.func linkonce_odr @_ZN6StringC1EPKc -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: %3 = cir.load %1 : !cir.ptr>, !cir.ptr -// CHECK-NEXT: cir.call @_ZN6StringC2EPKc(%2, %3) : (!cir.ptr, !cir.ptr) -> () +// CHECK-NEXT: cir.call @_ZN6StringC2EPKc(%2, %3) : (!cir.ptr, !cir.ptr) -> () // CHECK-NEXT: cir.return // CHECK: cir.func @_Z4testv() -// CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () -// CHECK: cir.call @_ZN6StringC1Ei(%1, %3) : (!cir.ptr, !s32i) -> () -// CHECK: cir.call @_ZN6StringC1EPKc(%2, %5) : (!cir.ptr, !cir.ptr) -> () +// CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN6StringC1Ei(%1, %3) : (!cir.ptr, !s32i) -> () +// CHECK: cir.call @_ZN6StringC1EPKc(%2, %5) : (!cir.ptr, !cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/abstract-cond.c b/clang/test/CIR/CodeGen/abstract-cond.c index 9e44c7a2e968..01b9638e7fd3 100644 --- a/clang/test/CIR/CodeGen/abstract-cond.c +++ b/clang/test/CIR/CodeGen/abstract-cond.c @@ -11,17 +11,17 @@ int f6(int a0, struct s6 a1, struct s6 a2) { // CIR-LABEL: @f6 // CIR: %[[A0:.*]] = cir.alloca !s32i, !cir.ptr, ["a0" -// CIR: %[[A1:.*]] = cir.alloca !ty_s6, !cir.ptr, ["a1" -// CIR: %[[A2:.*]] = cir.alloca !ty_s6, !cir.ptr, ["a2" -// CIR: %[[TMP:.*]] = cir.alloca !ty_s6, !cir.ptr, ["tmp"] {alignment = 4 : i64} +// CIR: %[[A1:.*]] = cir.alloca !rec_s6, !cir.ptr, ["a1" +// CIR: %[[A2:.*]] = cir.alloca !rec_s6, !cir.ptr, ["a2" +// CIR: %[[TMP:.*]] = cir.alloca !rec_s6, !cir.ptr, ["tmp"] {alignment = 4 : i64} // CIR: %[[LOAD_A0:.*]] = cir.load %[[A0]] : !cir.ptr, !s32i // CIR: %[[COND:.*]] = cir.cast(int_to_bool, %[[LOAD_A0]] : !s32i), !cir.bool // CIR: cir.if %[[COND]] { -// CIR: cir.copy %[[A1]] to %[[TMP]] : !cir.ptr +// CIR: cir.copy %[[A1]] to %[[TMP]] : !cir.ptr // CIR: } else { -// CIR: cir.copy %[[A2]] to %[[TMP]] : !cir.ptr +// CIR: cir.copy %[[A2]] to %[[TMP]] : !cir.ptr // CIR: } -// CIR: cir.get_member %[[TMP]][0] {name = "f0"} : !cir.ptr -> !cir.ptr +// CIR: cir.get_member %[[TMP]][0] {name = "f0"} : !cir.ptr -> !cir.ptr // LLVM-LABEL: @f6 // LLVM: %[[LOAD_A0:.*]] = load i32, ptr {{.*}} diff --git a/clang/test/CIR/CodeGen/agg-copy.c b/clang/test/CIR/CodeGen/agg-copy.c index d29f296d878d..792d85710409 100644 --- a/clang/test/CIR/CodeGen/agg-copy.c +++ b/clang/test/CIR/CodeGen/agg-copy.c @@ -10,53 +10,53 @@ typedef struct { } A; // CHECK: cir.func @foo1 -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] -// CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a2", init] -// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> -// CHECK: cir.store %arg1, [[TMP1]] : !cir.ptr, !cir.ptr> -// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] +// CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a2", init] +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CHECK: cir.store %arg1, [[TMP1]] : !cir.ptr, !cir.ptr> +// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr // CHECK: [[TMP3:%.*]] = cir.const #cir.int<1> : !s32i -// CHECK: [[TMP4:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr, [[TMP3]] : !s32i), !cir.ptr -// CHECK: [[TMP5:%.*]] = cir.load [[TMP1]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP4:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr, [[TMP3]] : !s32i), !cir.ptr +// CHECK: [[TMP5:%.*]] = cir.load [[TMP1]] : !cir.ptr>, !cir.ptr // CHECK: [[TMP6:%.*]] = cir.const #cir.int<1> : !s32i -// CHECK: [[TMP7:%.*]] = cir.ptr_stride([[TMP5]] : !cir.ptr, [[TMP6]] : !s32i), !cir.ptr -// CHECK: cir.copy [[TMP7]] to [[TMP4]] : !cir.ptr +// CHECK: [[TMP7:%.*]] = cir.ptr_stride([[TMP5]] : !cir.ptr, [[TMP6]] : !s32i), !cir.ptr +// CHECK: cir.copy [[TMP7]] to [[TMP4]] : !cir.ptr void foo1(A* a1, A* a2) { a1[1] = a2[1]; } // CHECK: cir.func @foo2 -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] -// CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a2", init] -// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> -// CHECK: cir.store %arg1, [[TMP1]] : !cir.ptr, !cir.ptr> -// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: [[TMP3:%.*]] = cir.get_member [[TMP2]][2] {name = "s"} : !cir.ptr -> !cir.ptr -// CHECK: [[TMP4:%.*]] = cir.load [[TMP1]] : !cir.ptr>, !cir.ptr -// CHECK: [[TMP5:%.*]] = cir.get_member [[TMP4]][2] {name = "s"} : !cir.ptr -> !cir.ptr -// CHECK: cir.copy [[TMP5]] to [[TMP3]] : !cir.ptr +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] +// CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a2", init] +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CHECK: cir.store %arg1, [[TMP1]] : !cir.ptr, !cir.ptr> +// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP3:%.*]] = cir.get_member [[TMP2]][2] {name = "s"} : !cir.ptr -> !cir.ptr +// CHECK: [[TMP4:%.*]] = cir.load [[TMP1]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP5:%.*]] = cir.get_member [[TMP4]][2] {name = "s"} : !cir.ptr -> !cir.ptr +// CHECK: cir.copy [[TMP5]] to [[TMP3]] : !cir.ptr void foo2(A* a1, A* a2) { a1->s = a2->s; } -// CHECK: cir.global external @a = #cir.zero : !ty_A +// CHECK: cir.global external @a = #cir.zero : !rec_A // CHECK: cir.func @foo3 -// CHECK: [[TMP0]] = cir.alloca !ty_A, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: [[TMP1]] = cir.get_global @a : !cir.ptr -// CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr -// CHECK: [[TMP2]] = cir.load [[TMP0]] : !cir.ptr, !ty_A -// CHECK: cir.return [[TMP2]] : !ty_A +// CHECK: [[TMP0]] = cir.alloca !rec_A, !cir.ptr, ["__retval"] {alignment = 4 : i64} +// CHECK: [[TMP1]] = cir.get_global @a : !cir.ptr +// CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr +// CHECK: [[TMP2]] = cir.load [[TMP0]] : !cir.ptr, !rec_A +// CHECK: cir.return [[TMP2]] : !rec_A A a; A foo3(void) { return a; } // CHECK: cir.func @foo4 -// CHECK: [[TMP0]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] -// CHECK: [[TMP1]] = cir.alloca !ty_A, !cir.ptr, ["a2", init] -// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> -// CHECK: [[TMP2]] = cir.load deref [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: cir.copy [[TMP2]] to [[TMP1]] : !cir.ptr +// CHECK: [[TMP0]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] +// CHECK: [[TMP1]] = cir.alloca !rec_A, !cir.ptr, ["a2", init] +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CHECK: [[TMP2]] = cir.load deref [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: cir.copy [[TMP2]] to [[TMP1]] : !cir.ptr void foo4(A* a1) { A a2 = *a1; } @@ -64,11 +64,11 @@ void foo4(A* a1) { A create() { A a; return a; } // CHECK: cir.func {{.*@foo5}} -// CHECK: [[TMP0:%.*]] = cir.alloca !ty_A, !cir.ptr, -// CHECK: [[TMP1:%.*]] = cir.alloca !ty_A, !cir.ptr, ["tmp"] {alignment = 4 : i64} -// CHECK: [[TMP2:%.*]] = cir.call @create() : () -> !ty_A -// CHECK: cir.store [[TMP2]], [[TMP1]] : !ty_A, !cir.ptr -// CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr +// CHECK: [[TMP0:%.*]] = cir.alloca !rec_A, !cir.ptr, +// CHECK: [[TMP1:%.*]] = cir.alloca !rec_A, !cir.ptr, ["tmp"] {alignment = 4 : i64} +// CHECK: [[TMP2:%.*]] = cir.call @create() : () -> !rec_A +// CHECK: cir.store [[TMP2]], [[TMP1]] : !rec_A, !cir.ptr +// CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr void foo5() { A a; a = create(); @@ -77,11 +77,11 @@ void foo5() { void foo6(A* a1) { A a2 = (*a1); // CHECK: cir.func {{.*@foo6}} -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] {alignment = 8 : i64} -// CHECK: [[TMP1:%.*]] = cir.alloca !ty_A, !cir.ptr, ["a2", init] {alignment = 4 : i64} -// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> -// CHECK: [[TMP2:%.*]] = cir.load deref [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: cir.copy [[TMP2]] to [[TMP1]] : !cir.ptr +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] {alignment = 8 : i64} +// CHECK: [[TMP1:%.*]] = cir.alloca !rec_A, !cir.ptr, ["a2", init] {alignment = 4 : i64} +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CHECK: [[TMP2:%.*]] = cir.load deref [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: cir.copy [[TMP2]] to [[TMP1]] : !cir.ptr } volatile A vol_a; @@ -91,4 +91,4 @@ A foo7() { // CHECK: cir.func {{.*@foo7}} // CHECK: %0 = cir.alloca // CHECK: %1 = cir.get_global @vol_a -// CHECK: cir.copy %1 to %0 volatile \ No newline at end of file +// CHECK: cir.copy %1 to %0 volatile diff --git a/clang/test/CIR/CodeGen/agg-init.cpp b/clang/test/CIR/CodeGen/agg-init.cpp index 9629f4b07b62..d5b26ba048f2 100644 --- a/clang/test/CIR/CodeGen/agg-init.cpp +++ b/clang/test/CIR/CodeGen/agg-init.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -Wno-unused-value -emit-cir %s -o %t.cir // RUN: FileCheck --input-file=%t.cir %s -// CHECK: !ty_yep_ = !cir.record +// CHECK: !rec_yep_ = !cir.record typedef enum xxy_ { xxy_Low = 0, @@ -17,11 +17,11 @@ typedef struct yep_ { void use() { yop{}; } // CHECK: cir.func @_Z3usev() -// CHECK: %0 = cir.alloca !ty_yep_, !cir.ptr, ["agg.tmp.ensured"] {alignment = 4 : i64} -// CHECK: %1 = cir.get_member %0[0] {name = "Status"} : !cir.ptr -> !cir.ptr +// CHECK: %0 = cir.alloca !rec_yep_, !cir.ptr, ["agg.tmp.ensured"] {alignment = 4 : i64} +// CHECK: %1 = cir.get_member %0[0] {name = "Status"} : !cir.ptr -> !cir.ptr // CHECK: %2 = cir.const #cir.int<0> : !u32i // CHECK: cir.store %2, %1 : !u32i, !cir.ptr -// CHECK: %3 = cir.get_member %0[1] {name = "HC"} : !cir.ptr -> !cir.ptr +// CHECK: %3 = cir.get_member %0[1] {name = "HC"} : !cir.ptr -> !cir.ptr // CHECK: %4 = cir.const #cir.int<0> : !u32i // CHECK: cir.store %4, %3 : !u32i, !cir.ptr // CHECK: cir.return @@ -47,16 +47,16 @@ void yo() { } // CHECK: cir.func @_Z2yov() -// CHECK: %0 = cir.alloca !ty_Yo, !cir.ptr, ["ext"] {alignment = 8 : i64} -// CHECK: %1 = cir.alloca !ty_Yo, !cir.ptr, ["ext2", init] {alignment = 8 : i64} -// CHECK: %2 = cir.const #cir.const_record<{#cir.int<1000070000> : !u32i, #cir.ptr : !cir.ptr, #cir.int<0> : !u64i}> : !ty_Yo -// CHECK: cir.store %2, %0 : !ty_Yo, !cir.ptr -// CHECK: %3 = cir.get_member %1[0] {name = "type"} : !cir.ptr -> !cir.ptr +// CHECK: %0 = cir.alloca !rec_Yo, !cir.ptr, ["ext"] {alignment = 8 : i64} +// CHECK: %1 = cir.alloca !rec_Yo, !cir.ptr, ["ext2", init] {alignment = 8 : i64} +// CHECK: %2 = cir.const #cir.const_record<{#cir.int<1000070000> : !u32i, #cir.ptr : !cir.ptr, #cir.int<0> : !u64i}> : !rec_Yo +// CHECK: cir.store %2, %0 : !rec_Yo, !cir.ptr +// CHECK: %3 = cir.get_member %1[0] {name = "type"} : !cir.ptr -> !cir.ptr // CHECK: %4 = cir.const #cir.int<1000066001> : !u32i // CHECK: cir.store %4, %3 : !u32i, !cir.ptr -// CHECK: %5 = cir.get_member %1[1] {name = "next"} : !cir.ptr -> !cir.ptr> -// CHECK: %6 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr +// CHECK: %5 = cir.get_member %1[1] {name = "next"} : !cir.ptr -> !cir.ptr> +// CHECK: %6 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr // CHECK: cir.store %6, %5 : !cir.ptr, !cir.ptr> -// CHECK: %7 = cir.get_member %1[2] {name = "createFlags"} : !cir.ptr -> !cir.ptr +// CHECK: %7 = cir.get_member %1[2] {name = "createFlags"} : !cir.ptr -> !cir.ptr // CHECK: %8 = cir.const #cir.int<0> : !u64i // CHECK: cir.store %8, %7 : !u64i, !cir.ptr diff --git a/clang/test/CIR/CodeGen/agg-init2.cpp b/clang/test/CIR/CodeGen/agg-init2.cpp index 4eef5e40c25e..47a881308750 100644 --- a/clang/test/CIR/CodeGen/agg-init2.cpp +++ b/clang/test/CIR/CodeGen/agg-init2.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -Wno-unused-value -emit-cir %s -o %t.cir // RUN: FileCheck --input-file=%t.cir %s -// CHECK: !ty_Zero = !cir.record +// CHECK: !rec_Zero = !cir.record struct Zero { void yolo(); @@ -14,7 +14,7 @@ void f() { } // CHECK: cir.func @_Z1fv() -// CHECK: %0 = cir.alloca !ty_Zero, !cir.ptr, ["z0", init] -// CHECK: %1 = cir.alloca !ty_Zero, !cir.ptr, ["z1"] -// CHECK: cir.call @_ZN4ZeroC1Ev(%0) : (!cir.ptr) -> () +// CHECK: %0 = cir.alloca !rec_Zero, !cir.ptr, ["z0", init] +// CHECK: %1 = cir.alloca !rec_Zero, !cir.ptr, ["z1"] +// CHECK: cir.call @_ZN4ZeroC1Ev(%0) : (!cir.ptr) -> () // CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/array-init-destroy.cpp b/clang/test/CIR/CodeGen/array-init-destroy.cpp index 9bc39cec84c0..874e85738eea 100644 --- a/clang/test/CIR/CodeGen/array-init-destroy.cpp +++ b/clang/test/CIR/CodeGen/array-init-destroy.cpp @@ -20,43 +20,43 @@ void x() { } // BEFORE: cir.func @_Z1xv() -// BEFORE: %[[ArrayAddr:.*]] = cir.alloca !cir.array +// BEFORE: %[[ArrayAddr:.*]] = cir.alloca !cir.array -// BEFORE: cir.array.ctor(%[[ArrayAddr]] : !cir.ptr>) { -// BEFORE: ^bb0(%arg0: !cir.ptr -// BEFORE: cir.call @_ZN4xptoC1Ev(%arg0) : (!cir.ptr) -> () +// BEFORE: cir.array.ctor(%[[ArrayAddr]] : !cir.ptr>) { +// BEFORE: ^bb0(%arg0: !cir.ptr +// BEFORE: cir.call @_ZN4xptoC1Ev(%arg0) : (!cir.ptr) -> () // BEFORE: cir.yield // BEFORE: } -// BEFORE: cir.array.dtor(%[[ArrayAddr]] : !cir.ptr>) { -// BEFORE: ^bb0(%arg0: !cir.ptr -// BEFORE: cir.call @_ZN4xptoD1Ev(%arg0) : (!cir.ptr) -> () +// BEFORE: cir.array.dtor(%[[ArrayAddr]] : !cir.ptr>) { +// BEFORE: ^bb0(%arg0: !cir.ptr +// BEFORE: cir.call @_ZN4xptoD1Ev(%arg0) : (!cir.ptr) -> () // BEFORE: cir.yield // BEFORE: } // AFTER: cir.func @_Z1xv() -// AFTER: %[[ArrayAddr0:.*]] = cir.alloca !cir.array +// AFTER: %[[ArrayAddr0:.*]] = cir.alloca !cir.array // AFTER: %[[ConstTwo:.*]] = cir.const #cir.int<2> : !u64i -// AFTER: %[[ArrayBegin:.*]] = cir.cast(array_to_ptrdecay, %[[ArrayAddr0]] : !cir.ptr>), !cir.ptr -// AFTER: %[[ArrayPastEnd:.*]] = cir.ptr_stride(%[[ArrayBegin]] : !cir.ptr, %[[ConstTwo]] : !u64i), !cir.ptr -// AFTER: %[[TmpIdx:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__array_idx"] {alignment = 1 : i64} -// AFTER: cir.store %[[ArrayBegin]], %[[TmpIdx]] : !cir.ptr, !cir.ptr> +// AFTER: %[[ArrayBegin:.*]] = cir.cast(array_to_ptrdecay, %[[ArrayAddr0]] : !cir.ptr>), !cir.ptr +// AFTER: %[[ArrayPastEnd:.*]] = cir.ptr_stride(%[[ArrayBegin]] : !cir.ptr, %[[ConstTwo]] : !u64i), !cir.ptr +// AFTER: %[[TmpIdx:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__array_idx"] {alignment = 1 : i64} +// AFTER: cir.store %[[ArrayBegin]], %[[TmpIdx]] : !cir.ptr, !cir.ptr> // AFTER: cir.do { -// AFTER: %[[ArrayElt:.*]] = cir.load %[[TmpIdx]] : !cir.ptr>, !cir.ptr +// AFTER: %[[ArrayElt:.*]] = cir.load %[[TmpIdx]] : !cir.ptr>, !cir.ptr // AFTER: %[[ConstOne:.*]] = cir.const #cir.int<1> : !u64i -// AFTER: cir.call @_ZN4xptoC1Ev(%[[ArrayElt]]) : (!cir.ptr) -> () -// AFTER: %[[NextElt:.*]] = cir.ptr_stride(%[[ArrayElt]] : !cir.ptr, %[[ConstOne]] : !u64i), !cir.ptr -// AFTER: cir.store %[[NextElt]], %[[TmpIdx]] : !cir.ptr, !cir.ptr> +// AFTER: cir.call @_ZN4xptoC1Ev(%[[ArrayElt]]) : (!cir.ptr) -> () +// AFTER: %[[NextElt:.*]] = cir.ptr_stride(%[[ArrayElt]] : !cir.ptr, %[[ConstOne]] : !u64i), !cir.ptr +// AFTER: cir.store %[[NextElt]], %[[TmpIdx]] : !cir.ptr, !cir.ptr> // AFTER: cir.yield // AFTER: } while { -// AFTER: %[[ArrayElt:.*]] = cir.load %[[TmpIdx]] : !cir.ptr>, !cir.ptr -// AFTER: %[[ExitCond:.*]] = cir.cmp(eq, %[[ArrayElt]], %[[ArrayPastEnd]]) : !cir.ptr, !cir.bool +// AFTER: %[[ArrayElt:.*]] = cir.load %[[TmpIdx]] : !cir.ptr>, !cir.ptr +// AFTER: %[[ExitCond:.*]] = cir.cmp(eq, %[[ArrayElt]], %[[ArrayPastEnd]]) : !cir.ptr, !cir.bool // AFTER: cir.condition(%[[ExitCond]]) // AFTER: } // AFTER: cir.do { -// AFTER: cir.call @_ZN4xptoD1Ev({{.*}}) : (!cir.ptr) -> () +// AFTER: cir.call @_ZN4xptoD1Ev({{.*}}) : (!cir.ptr) -> () // AFTER: } while { // AFTER: } -// AFTER: cir.return \ No newline at end of file +// AFTER: cir.return diff --git a/clang/test/CIR/CodeGen/array-init.c b/clang/test/CIR/CodeGen/array-init.c index 19ada3a8ceb8..a01c8649f72b 100644 --- a/clang/test/CIR/CodeGen/array-init.c +++ b/clang/test/CIR/CodeGen/array-init.c @@ -14,20 +14,20 @@ void buz(int x) { } // CIR: cir.func @buz // CIR-NEXT: [[X_ALLOCA:%.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} -// CIR-NEXT: [[ARR:%.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr", init] {alignment = 16 : i64} +// CIR-NEXT: [[ARR:%.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr", init] {alignment = 16 : i64} // CIR-NEXT: cir.store %arg0, [[X_ALLOCA]] : !s32i, !cir.ptr -// CIR-NEXT: [[ARR_INIT:%.*]] = cir.const #cir.zero : !cir.array -// CIR-NEXT: cir.store [[ARR_INIT]], [[ARR]] : !cir.array, !cir.ptr> -// CIR-NEXT: [[FI_EL:%.*]] = cir.cast(array_to_ptrdecay, [[ARR]] : !cir.ptr>), !cir.ptr -// CIR-NEXT: [[A_STORAGE0:%.*]] = cir.get_member [[FI_EL]][0] {name = "a"} : !cir.ptr -> !cir.ptr -// CIR-NEXT: [[B_STORAGE0:%.*]] = cir.get_member [[FI_EL]][1] {name = "b"} : !cir.ptr -> !cir.ptr +// CIR-NEXT: [[ARR_INIT:%.*]] = cir.const #cir.zero : !cir.array +// CIR-NEXT: cir.store [[ARR_INIT]], [[ARR]] : !cir.array, !cir.ptr> +// CIR-NEXT: [[FI_EL:%.*]] = cir.cast(array_to_ptrdecay, [[ARR]] : !cir.ptr>), !cir.ptr +// CIR-NEXT: [[A_STORAGE0:%.*]] = cir.get_member [[FI_EL]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CIR-NEXT: [[B_STORAGE0:%.*]] = cir.get_member [[FI_EL]][1] {name = "b"} : !cir.ptr -> !cir.ptr // CIR-NEXT: [[X_VAL:%.*]] = cir.load [[X_ALLOCA]] : !cir.ptr, !s32i // CIR-NEXT: [[X_CASTED:%.*]] = cir.cast(integral, [[X_VAL]] : !s32i), !s64i // CIR-NEXT: cir.store [[X_CASTED]], [[B_STORAGE0]] : !s64i, !cir.ptr // CIR-NEXT: [[ONE:%.*]] = cir.const #cir.int<1> : !s64i -// CIR-NEXT: [[SE_EL:%.*]] = cir.ptr_stride([[FI_EL]] : !cir.ptr, [[ONE]] : !s64i), !cir.ptr -// CIR-NEXT: [[A_STORAGE1:%.*]] = cir.get_member [[SE_EL]][0] {name = "a"} : !cir.ptr -> !cir.ptr -// CIR-NEXT: [[B_STORAGE1:%.*]] = cir.get_member [[SE_EL]][1] {name = "b"} : !cir.ptr -> !cir.ptr +// CIR-NEXT: [[SE_EL:%.*]] = cir.ptr_stride([[FI_EL]] : !cir.ptr, [[ONE]] : !s64i), !cir.ptr +// CIR-NEXT: [[A_STORAGE1:%.*]] = cir.get_member [[SE_EL]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CIR-NEXT: [[B_STORAGE1:%.*]] = cir.get_member [[SE_EL]][1] {name = "b"} : !cir.ptr -> !cir.ptr // CIR-NEXT: cir.return void foo() { diff --git a/clang/test/CIR/CodeGen/array-init.cpp b/clang/test/CIR/CodeGen/array-init.cpp index e051c31a9c6c..069b26ee7d13 100644 --- a/clang/test/CIR/CodeGen/array-init.cpp +++ b/clang/test/CIR/CodeGen/array-init.cpp @@ -13,12 +13,12 @@ int bar() { void foo() { A a = {bar(), {}}; } -// CHECK: %[[VAL_0:.*]] = cir.alloca !ty_A, !cir.ptr, ["a", init] +// CHECK: %[[VAL_0:.*]] = cir.alloca !rec_A, !cir.ptr, ["a", init] // CHECK: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["arrayinit.temp", init] -// CHECK: %[[VAL_2:.*]] = cir.get_member %[[VAL_0]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CHECK: %[[VAL_2:.*]] = cir.get_member %[[VAL_0]][0] {name = "a"} : !cir.ptr -> !cir.ptr // CHECK: %[[VAL_3:.*]] = cir.call @_Z3barv() : () -> !s32i // CHECK: cir.store %[[VAL_3]], %[[VAL_2]] : !s32i, !cir.ptr -// CHECK: %[[VAL_4:.*]] = cir.get_member %[[VAL_0]][1] {name = "b"} : !cir.ptr -> !cir.ptr> +// CHECK: %[[VAL_4:.*]] = cir.get_member %[[VAL_0]][1] {name = "b"} : !cir.ptr -> !cir.ptr> // CHECK: %[[VAL_5:.*]] = cir.cast(array_to_ptrdecay, %[[VAL_4]] : !cir.ptr>), !cir.ptr // CHECK: cir.store %[[VAL_5]], %[[VAL_1]] : !cir.ptr, !cir.ptr> // CHECK: %[[VAL_6:.*]] = cir.const #cir.int<2> : !s64i @@ -35,4 +35,4 @@ void foo() { // CHECK: %[[VAL_8:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr // CHECK: %[[VAL_9:.*]] = cir.cmp(ne, %[[VAL_8]], %[[VAL_7]]) : !cir.ptr, !cir.bool // CHECK: cir.condition(%[[VAL_9]]) -// CHECK: } \ No newline at end of file +// CHECK: } diff --git a/clang/test/CIR/CodeGen/array-new-init.cpp b/clang/test/CIR/CodeGen/array-new-init.cpp index 263c2a3edfe4..884b9bbd7fe4 100644 --- a/clang/test/CIR/CodeGen/array-new-init.cpp +++ b/clang/test/CIR/CodeGen/array-new-init.cpp @@ -21,11 +21,11 @@ void t_new_constant_size_constructor() { // BEFORE: %[[PTR_AS_U8:.*]] = cir.cast(bitcast, %[[ALLOC_PTR]] : !cir.ptr), !cir.ptr // BEFORE: %[[OFFSET:.*]] = cir.const #cir.int<8> : !s32i // BEFORE: %[[OBJ_PTR:.*]] = cir.ptr_stride(%[[PTR_AS_U8]] : !cir.ptr, %[[OFFSET]] : !s32i), !cir.ptr -// BEFORE: %[[OBJ_ELEM_PTR:.*]] = cir.cast(bitcast, %[[OBJ_PTR]] : !cir.ptr), !cir.ptr -// BEFORE: %[[OBJ_ARRAY_PTR:.*]] = cir.cast(bitcast, %[[OBJ_ELEM_PTR]] : !cir.ptr), !cir.ptr> -// BEFORE: cir.array.ctor(%[[OBJ_ARRAY_PTR]] : !cir.ptr>) { -// BEFORE: ^bb0(%arg0: !cir.ptr -// BEFORE: cir.call @_ZN1EC1Ev(%arg0) : (!cir.ptr) -> () +// BEFORE: %[[OBJ_ELEM_PTR:.*]] = cir.cast(bitcast, %[[OBJ_PTR]] : !cir.ptr), !cir.ptr +// BEFORE: %[[OBJ_ARRAY_PTR:.*]] = cir.cast(bitcast, %[[OBJ_ELEM_PTR]] : !cir.ptr), !cir.ptr> +// BEFORE: cir.array.ctor(%[[OBJ_ARRAY_PTR]] : !cir.ptr>) { +// BEFORE: ^bb0(%arg0: !cir.ptr +// BEFORE: cir.call @_ZN1EC1Ev(%arg0) : (!cir.ptr) -> () // BEFORE: cir.yield // BEFORE: } @@ -39,22 +39,22 @@ void t_new_constant_size_constructor() { // AFTER: %[[PTR_AS_U8:.*]] = cir.cast(bitcast, %[[ALLOC_PTR]] : !cir.ptr), !cir.ptr // AFTER: %[[OFFSET:.*]] = cir.const #cir.int<8> : !s32i // AFTER: %[[OBJ_PTR:.*]] = cir.ptr_stride(%[[PTR_AS_U8]] : !cir.ptr, %[[OFFSET]] : !s32i), !cir.ptr -// AFTER: %[[OBJ_ELEM_PTR:.*]] = cir.cast(bitcast, %[[OBJ_PTR]] : !cir.ptr), !cir.ptr -// AFTER: %[[OBJ_ARRAY_PTR:.*]] = cir.cast(bitcast, %[[OBJ_ELEM_PTR]] : !cir.ptr), !cir.ptr> +// AFTER: %[[OBJ_ELEM_PTR:.*]] = cir.cast(bitcast, %[[OBJ_PTR]] : !cir.ptr), !cir.ptr +// AFTER: %[[OBJ_ARRAY_PTR:.*]] = cir.cast(bitcast, %[[OBJ_ELEM_PTR]] : !cir.ptr), !cir.ptr> // AFTER: %[[NUM_ELEMENTS2:.*]] = cir.const #cir.int<3> : !u64i -// AFTER: %[[ELEM_PTR:.*]] = cir.cast(array_to_ptrdecay, %10 : !cir.ptr>), !cir.ptr -// AFTER: %[[END_PTR:.*]] = cir.ptr_stride(%[[ELEM_PTR]] : !cir.ptr, %[[NUM_ELEMENTS2]] : !u64i), !cir.ptr -// AFTER: %[[CUR_ELEM_ALLOCA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__array_idx"] {alignment = 1 : i64} -// AFTER: cir.store %[[ELEM_PTR]], %[[CUR_ELEM_ALLOCA]] : !cir.ptr, !cir.ptr> +// AFTER: %[[ELEM_PTR:.*]] = cir.cast(array_to_ptrdecay, %10 : !cir.ptr>), !cir.ptr +// AFTER: %[[END_PTR:.*]] = cir.ptr_stride(%[[ELEM_PTR]] : !cir.ptr, %[[NUM_ELEMENTS2]] : !u64i), !cir.ptr +// AFTER: %[[CUR_ELEM_ALLOCA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__array_idx"] {alignment = 1 : i64} +// AFTER: cir.store %[[ELEM_PTR]], %[[CUR_ELEM_ALLOCA]] : !cir.ptr, !cir.ptr> // AFTER: cir.do { -// AFTER: %[[CUR_ELEM_PTR:.*]] = cir.load %[[CUR_ELEM_ALLOCA]] : !cir.ptr>, !cir.ptr +// AFTER: %[[CUR_ELEM_PTR:.*]] = cir.load %[[CUR_ELEM_ALLOCA]] : !cir.ptr>, !cir.ptr // AFTER: %[[OFFSET:.*]] = cir.const #cir.int<1> : !u64i -// AFTER: cir.call @_ZN1EC1Ev(%[[CUR_ELEM_PTR]]) : (!cir.ptr) -> () -// AFTER: %[[NEXT_PTR:.*]] = cir.ptr_stride(%[[CUR_ELEM_PTR]] : !cir.ptr, %[[OFFSET]] : !u64i), !cir.ptr -// AFTER: cir.store %[[NEXT_PTR]], %[[CUR_ELEM_ALLOCA]] : !cir.ptr, !cir.ptr> +// AFTER: cir.call @_ZN1EC1Ev(%[[CUR_ELEM_PTR]]) : (!cir.ptr) -> () +// AFTER: %[[NEXT_PTR:.*]] = cir.ptr_stride(%[[CUR_ELEM_PTR]] : !cir.ptr, %[[OFFSET]] : !u64i), !cir.ptr +// AFTER: cir.store %[[NEXT_PTR]], %[[CUR_ELEM_ALLOCA]] : !cir.ptr, !cir.ptr> // AFTER: cir.yield // AFTER: } while { -// AFTER: %[[CUR_ELEM_PTR2:.*]] = cir.load %[[CUR_ELEM_ALLOCA]] : !cir.ptr>, !cir.ptr -// AFTER: %[[END_TEST:.*]] = cir.cmp(eq, %[[CUR_ELEM_PTR2]], %[[END_PTR]]) : !cir.ptr, !cir.bool +// AFTER: %[[CUR_ELEM_PTR2:.*]] = cir.load %[[CUR_ELEM_ALLOCA]] : !cir.ptr>, !cir.ptr +// AFTER: %[[END_TEST:.*]] = cir.cmp(eq, %[[CUR_ELEM_PTR2]], %[[END_PTR]]) : !cir.ptr, !cir.bool // AFTER: cir.condition(%[[END_TEST]]) // AFTER: } diff --git a/clang/test/CIR/CodeGen/array.c b/clang/test/CIR/CodeGen/array.c index 80f42c93a929..4fc16d4ba6cc 100644 --- a/clang/test/CIR/CodeGen/array.c +++ b/clang/test/CIR/CodeGen/array.c @@ -5,7 +5,7 @@ struct S { int i; } arr[3] = {{1}}; -// CHECK: cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S, #cir.zero : !ty_S, #cir.zero : !ty_S]> : !cir.array +// CHECK: cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S, #cir.zero : !rec_S, #cir.zero : !rec_S]> : !cir.array int a[4]; // CHECK: cir.global external @a = #cir.zero : !cir.array diff --git a/clang/test/CIR/CodeGen/array.cpp b/clang/test/CIR/CodeGen/array.cpp index b6209dec6c3a..1aedb8795954 100644 --- a/clang/test/CIR/CodeGen/array.cpp +++ b/clang/test/CIR/CodeGen/array.cpp @@ -70,7 +70,7 @@ int globalNullArr[] = {0, 0}; struct S { int i; } arr[3] = {{1}}; -// CHECK: cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S, #cir.zero : !ty_S, #cir.zero : !ty_S]> : !cir.array +// CHECK: cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S, #cir.zero : !rec_S, #cir.zero : !rec_S]> : !cir.array void testPointerDecaySubscriptAccess(int arr[]) { // CHECK: cir.func @{{.+}}testPointerDecaySubscriptAccess diff --git a/clang/test/CIR/CodeGen/asm.c b/clang/test/CIR/CodeGen/asm.c index c78eba8b3fc5..1e9625115ceb 100644 --- a/clang/test/CIR/CodeGen/asm.c +++ b/clang/test/CIR/CodeGen/asm.c @@ -51,7 +51,7 @@ void empty5(int x) { // CHECK: out = [], // CHECK: in = [], // CHECK: in_out = [%2 : !s32i], -// CHECK: {"" "=&r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) side_effects -> !ty_anon2E0 +// CHECK: {"" "=&r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) side_effects -> !rec_anon2E0 void empty6(int x) { __asm__ volatile("" : "=&r"(x), "+&r"(x)); } diff --git a/clang/test/CIR/CodeGen/assign-operator.cpp b/clang/test/CIR/CodeGen/assign-operator.cpp index 47a815407874..bf237e7d74a6 100644 --- a/clang/test/CIR/CodeGen/assign-operator.cpp +++ b/clang/test/CIR/CodeGen/assign-operator.cpp @@ -12,11 +12,11 @@ struct String { // StringView::StringView(String const&) // // CHECK: cir.func linkonce_odr @_ZN10StringViewC2ERK6String - // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} - // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] {alignment = 8 : i64} - // CHECK: cir.store %arg0, %0 : !cir.ptr - // CHECK: cir.store %arg1, %1 : !cir.ptr - // CHECK: %2 = cir.load %0 : !cir.ptr> + // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} + // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] {alignment = 8 : i64} + // CHECK: cir.store %arg0, %0 : !cir.ptr + // CHECK: cir.store %arg1, %1 : !cir.ptr + // CHECK: %2 = cir.load %0 : !cir.ptr> // Get address of `this->size` @@ -24,7 +24,7 @@ struct String { // Get address of `s` - // CHECK: %4 = cir.load %1 : !cir.ptr> + // CHECK: %4 = cir.load %1 : !cir.ptr> // Get the address of s.size @@ -40,20 +40,20 @@ struct String { // StringView::operator=(StringView&&) // // CHECK: cir.func linkonce_odr @_ZN10StringViewaSEOS_ - // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} - // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["", init, const] {alignment = 8 : i64} - // CHECK: %2 = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} - // CHECK: cir.store %arg0, %0 : !cir.ptr - // CHECK: cir.store %arg1, %1 : !cir.ptr - // CHECK: %3 = cir.load deref %0 : !cir.ptr> - // CHECK: %4 = cir.load %1 : !cir.ptr> + // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} + // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["", init, const] {alignment = 8 : i64} + // CHECK: %2 = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} + // CHECK: cir.store %arg0, %0 : !cir.ptr + // CHECK: cir.store %arg1, %1 : !cir.ptr + // CHECK: %3 = cir.load deref %0 : !cir.ptr> + // CHECK: %4 = cir.load %1 : !cir.ptr> // CHECK: %5 = cir.get_member %4[0] {name = "size"} // CHECK: %6 = cir.load %5 : !cir.ptr, !s64i // CHECK: %7 = cir.get_member %3[0] {name = "size"} // CHECK: cir.store %6, %7 : !s64i, !cir.ptr - // CHECK: cir.store %3, %2 : !cir.ptr - // CHECK: %8 = cir.load %2 : !cir.ptr> - // CHECK: cir.return %8 : !cir.ptr + // CHECK: cir.store %3, %2 : !cir.ptr + // CHECK: %8 = cir.load %2 : !cir.ptr> + // CHECK: cir.return %8 : !cir.ptr // CHECK: } }; @@ -74,17 +74,17 @@ int main() { // CHECK: cir.func @main() -> !s32i // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: %1 = cir.alloca !ty_StringView, !cir.ptr, ["sv", init] {alignment = 8 : i64} -// CHECK: cir.call @_ZN10StringViewC2Ev(%1) : (!cir.ptr) -> () +// CHECK: %1 = cir.alloca !rec_StringView, !cir.ptr, ["sv", init] {alignment = 8 : i64} +// CHECK: cir.call @_ZN10StringViewC2Ev(%1) : (!cir.ptr) -> () // CHECK: cir.scope { -// CHECK: %3 = cir.alloca !ty_String, !cir.ptr, ["s", init] {alignment = 8 : i64} +// CHECK: %3 = cir.alloca !rec_String, !cir.ptr, ["s", init] {alignment = 8 : i64} // CHECK: %4 = cir.get_global @".str" : !cir.ptr> // CHECK: %5 = cir.cast(array_to_ptrdecay, %4 : !cir.ptr>), !cir.ptr -// CHECK: cir.call @_ZN6StringC2EPKc(%3, %5) : (!cir.ptr, !cir.ptr) -> () +// CHECK: cir.call @_ZN6StringC2EPKc(%3, %5) : (!cir.ptr, !cir.ptr) -> () // CHECK: cir.scope { -// CHECK: %6 = cir.alloca !ty_StringView, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} -// CHECK: cir.call @_ZN10StringViewC2ERK6String(%6, %3) : (!cir.ptr, !cir.ptr) -> () -// CHECK: %7 = cir.call @_ZN10StringViewaSEOS_(%1, %6) : (!cir.ptr, !cir.ptr) -> !cir.ptr +// CHECK: %6 = cir.alloca !rec_StringView, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} +// CHECK: cir.call @_ZN10StringViewC2ERK6String(%6, %3) : (!cir.ptr, !cir.ptr) -> () +// CHECK: %7 = cir.call @_ZN10StringViewaSEOS_(%1, %6) : (!cir.ptr, !cir.ptr) -> !cir.ptr // CHECK: } // CHECK: } // CHECK: %2 = cir.load %0 : !cir.ptr, !s32i @@ -108,9 +108,9 @@ struct ContainsNonTrivial { }; // CHECK-LABEL: cir.func @_ZN18ContainsNonTrivialaSERKS_( -// CHECK-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr -// CHECK-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr -// CHECK-NEXT: %[[#RETVAL:]] = cir.alloca !cir.ptr +// CHECK-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr +// CHECK-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr +// CHECK-NEXT: %[[#RETVAL:]] = cir.alloca !cir.ptr // CHECK-NEXT: cir.store %arg0, %[[#THIS]] // CHECK-NEXT: cir.store %arg1, %[[#OTHER]] // CHECK-NEXT: %[[#THIS_LOAD:]] = cir.load deref %[[#THIS]] @@ -155,9 +155,9 @@ struct Trivial { }; // CHECK-LABEL: cir.func linkonce_odr @_ZN7TrivialaSERKS_( -// CHECK-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr -// CHECK-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr -// CHECK-NEXT: %[[#RETVAL:]] = cir.alloca !cir.ptr +// CHECK-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr +// CHECK-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr +// CHECK-NEXT: %[[#RETVAL:]] = cir.alloca !cir.ptr // CHECK-NEXT: cir.store %arg0, %[[#THIS]] // CHECK-NEXT: cir.store %arg1, %[[#OTHER]] // CHECK-NEXT: %[[#THIS_LOAD:]] = cir.load deref %[[#THIS]] @@ -202,10 +202,10 @@ struct ContainsTrivialArray { // CHECK-LABEL: cir.func @_ZN20ContainsTrivialArrayaSERKS_( // CHECK: %[[#THIS_LOAD:]] = cir.load deref %[[#]] // CHECK-NEXT: %[[#THIS_ARR:]] = cir.get_member %[[#THIS_LOAD]][0] {name = "arr"} -// CHECK-NEXT: %[[#THIS_ARR_CAST:]] = cir.cast(bitcast, %[[#THIS_ARR]] : !cir.ptr>), !cir.ptr +// CHECK-NEXT: %[[#THIS_ARR_CAST:]] = cir.cast(bitcast, %[[#THIS_ARR]] : !cir.ptr>), !cir.ptr // CHECK-NEXT: %[[#OTHER_LOAD:]] = cir.load %[[#]] // CHECK-NEXT: %[[#OTHER_ARR:]] = cir.get_member %[[#OTHER_LOAD]][0] {name = "arr"} -// CHECK-NEXT: %[[#OTHER_ARR_CAST:]] = cir.cast(bitcast, %[[#OTHER_ARR]] : !cir.ptr>), !cir.ptr +// CHECK-NEXT: %[[#OTHER_ARR_CAST:]] = cir.cast(bitcast, %[[#OTHER_ARR]] : !cir.ptr>), !cir.ptr // CHECK-NEXT: %[[#MEMCPY_SIZE:]] = cir.const #cir.int<80> : !u64i // CHECK-NEXT: cir.libc.memcpy %[[#MEMCPY_SIZE]] bytes from %[[#OTHER_ARR_CAST]] to %[[#THIS_ARR_CAST]] ContainsTrivialArray & diff --git a/clang/test/CIR/CodeGen/atomic-thread-fence.c b/clang/test/CIR/CodeGen/atomic-thread-fence.c index a12fc643536b..016fe542b579 100644 --- a/clang/test/CIR/CodeGen/atomic-thread-fence.c +++ b/clang/test/CIR/CodeGen/atomic-thread-fence.c @@ -39,11 +39,11 @@ void modifyWithThreadFence(DataPtr d) { d->value = 42; } // CIR-LABEL: @modifyWithThreadFence -// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} +// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} // CIR: cir.atomic.fence syncscope(system) seq_cst // CIR: %[[VAL_42:.*]] = cir.const #cir.int<42> : !s32i -// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr -// CIR: %[[DATA_VALUE:.*]] = cir.get_member %[[LOAD_DATA]][0] {name = "value"} : !cir.ptr -> !cir.ptr +// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr +// CIR: %[[DATA_VALUE:.*]] = cir.get_member %[[LOAD_DATA]][0] {name = "value"} : !cir.ptr -> !cir.ptr // CIR: cir.store %[[VAL_42]], %[[DATA_VALUE]] : !s32i, !cir.ptr // CIR: cir.return @@ -60,11 +60,11 @@ void modifyWithSignalFence(DataPtr d) { d->value = 24; } // CIR-LABEL: @modifyWithSignalFence -// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} +// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} // CIR: cir.atomic.fence syncscope(single_thread) seq_cst // CIR: %[[VAL_42:.*]] = cir.const #cir.int<24> : !s32i -// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr -// CIR: %[[DATA_VALUE:.*]] = cir.get_member %[[LOAD_DATA]][0] {name = "value"} : !cir.ptr -> !cir.ptr +// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr +// CIR: %[[DATA_VALUE:.*]] = cir.get_member %[[LOAD_DATA]][0] {name = "value"} : !cir.ptr -> !cir.ptr // CIR: cir.store %[[VAL_42]], %[[DATA_VALUE]] : !s32i, !cir.ptr // CIR: cir.return @@ -81,11 +81,11 @@ void loadWithThreadFence(DataPtr d) { __atomic_load_n(&d->ptr, __ATOMIC_SEQ_CST); } // CIR-LABEL: @loadWithThreadFence -// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} +// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} // CIR: %[[ATOMIC_TEMP:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["atomic-temp"] {alignment = 8 : i64} // CIR: cir.atomic.fence syncscope(system) seq_cst -// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr -// CIR: %[[DATA_VALUE:.*]] = cir.get_member %[[LOAD_DATA]][1] {name = "ptr"} : !cir.ptr -> !cir.ptr> +// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr +// CIR: %[[DATA_VALUE:.*]] = cir.get_member %[[LOAD_DATA]][1] {name = "ptr"} : !cir.ptr -> !cir.ptr> // CIR: %[[CASTED_DATA_VALUE:.*]] = cir.cast(bitcast, %[[DATA_VALUE]] : !cir.ptr>), !cir.ptr // CIR: %[[CASTED_ATOMIC_TEMP:.*]] = cir.cast(bitcast, %[[ATOMIC_TEMP]] : !cir.ptr>), !cir.ptr // CIR: %[[ATOMIC_LOAD:.*]] = cir.load atomic(seq_cst) %[[CASTED_DATA_VALUE]] : !cir.ptr, !u64i @@ -110,11 +110,11 @@ void loadWithSignalFence(DataPtr d) { __atomic_load_n(&d->ptr, __ATOMIC_SEQ_CST); } // CIR-LABEL: @loadWithSignalFence -// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} +// CIR: %[[DATA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} // CIR: %[[ATOMIC_TEMP:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["atomic-temp"] {alignment = 8 : i64} // CIR: cir.atomic.fence syncscope(single_thread) seq_cst -// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr -// CIR: %[[DATA_PTR:.*]] = cir.get_member %[[LOAD_DATA]][1] {name = "ptr"} : !cir.ptr -> !cir.ptr> +// CIR: %[[LOAD_DATA:.*]] = cir.load %[[DATA]] : !cir.ptr>, !cir.ptr +// CIR: %[[DATA_PTR:.*]] = cir.get_member %[[LOAD_DATA]][1] {name = "ptr"} : !cir.ptr -> !cir.ptr> // CIR: %[[CASTED_DATA_PTR:.*]] = cir.cast(bitcast, %[[DATA_PTR]] : !cir.ptr>), !cir.ptr // CIR: %[[CASTED_ATOMIC_TEMP:.*]] = cir.cast(bitcast, %[[ATOMIC_TEMP]] : !cir.ptr>), !cir.ptr // CIR: %[[ATOMIC_LOAD:.*]] = cir.load atomic(seq_cst) %[[CASTED_DATA_PTR]] : !cir.ptr, !u64i diff --git a/clang/test/CIR/CodeGen/bitfield-union.c b/clang/test/CIR/CodeGen/bitfield-union.c index b0501c5876b4..96f21ab15977 100644 --- a/clang/test/CIR/CodeGen/bitfield-union.c +++ b/clang/test/CIR/CodeGen/bitfield-union.c @@ -13,20 +13,20 @@ void main() { d.z = 0; } -// CHECK: !ty_demo = !cir.record +// CHECK: !rec_demo = !cir.record // CHECK: #bfi_y = #cir.bitfield_info // CHECK: #bfi_z = #cir.bitfield_info // cir.func no_proto @main() extra(#fn_attr) { -// %0 = cir.alloca !ty_demo, !cir.ptr, ["d"] {alignment = 4 : i64} +// %0 = cir.alloca !rec_demo, !cir.ptr, ["d"] {alignment = 4 : i64} // %1 = cir.const #cir.int<1> : !s32i -// %2 = cir.get_member %0[0] {name = "x"} : !cir.ptr -> !cir.ptr +// %2 = cir.get_member %0[0] {name = "x"} : !cir.ptr -> !cir.ptr // cir.store %1, %2 : !s32i, !cir.ptr // %3 = cir.const #cir.int<2> : !s32i -// %4 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr +// %4 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr // %5 = cir.set_bitfield(#bfi_y, %4 : !cir.ptr, %3 : !s32i) -> !s32i // %6 = cir.const #cir.int<0> : !s32i loc(#loc10) -// %7 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr +// %7 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr // %8 = cir.set_bitfield(#bfi_z, %7 : !cir.ptr, %6 : !s32i) -> !s32i // cir.return // } diff --git a/clang/test/CIR/CodeGen/bitfields.c b/clang/test/CIR/CodeGen/bitfields.c index fbb36533225c..16e51efea8b5 100644 --- a/clang/test/CIR/CodeGen/bitfields.c +++ b/clang/test/CIR/CodeGen/bitfields.c @@ -55,22 +55,22 @@ typedef struct { // because (tail - startOffset) is 65 after 'l' field } U; -// CHECK: !ty_D = !cir.record -// CHECK: !ty_G = !cir.record -// CHECK: !ty_T = !cir.record -// CHECK: !ty_anon2E0 = !cir.record +// CHECK: !rec_D = !cir.record +// CHECK: !rec_G = !cir.record +// CHECK: !rec_T = !cir.record +// CHECK: !rec_anon2E0 = !cir.record // CHECK: #bfi_a = #cir.bitfield_info // CHECK: #bfi_e = #cir.bitfield_info -// CHECK: !ty_S = !cir.record, !u16i, !u32i}> -// CHECK: !ty_U = !cir.record}> -// CHECK: !ty___long = !cir.record}> -// CHECK: !ty_anon_struct = !cir.record, !s32i}> +// CHECK: !rec_S = !cir.record, !u16i, !u32i}> +// CHECK: !rec_U = !cir.record}> +// CHECK: !rec___long = !cir.record}> +// CHECK: !rec_anon_struct = !cir.record, !s32i}> // CHECK: #bfi_d = #cir.bitfield_info, size = 2, offset = 17, is_signed = true> // CHECK: cir.func {{.*@store_field}} -// CHECK: [[TMP0:%.*]] = cir.alloca !ty_S, !cir.ptr +// CHECK: [[TMP0:%.*]] = cir.alloca !rec_S, !cir.ptr // CHECK: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i -// CHECK: [[TMP2:%.*]] = cir.get_member [[TMP0]][2] {name = "e"} : !cir.ptr -> !cir.ptr +// CHECK: [[TMP2:%.*]] = cir.get_member [[TMP0]][2] {name = "e"} : !cir.ptr -> !cir.ptr // CHECK: cir.set_bitfield(#bfi_e, [[TMP2]] : !cir.ptr, [[TMP1]] : !s32i) void store_field() { S s; @@ -78,16 +78,16 @@ void store_field() { } // CHECK: cir.func {{.*@load_field}} -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] -// CHECK: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: [[TMP2:%.*]] = cir.get_member [[TMP1]][1] {name = "d"} : !cir.ptr -> !cir.ptr> +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] +// CHECK: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP2:%.*]] = cir.get_member [[TMP1]][1] {name = "d"} : !cir.ptr -> !cir.ptr> // CHECK: [[TMP3:%.*]] = cir.get_bitfield(#bfi_d, [[TMP2]] : !cir.ptr>) -> !s32i int load_field(S* s) { return s->d; } // CHECK: cir.func {{.*@unOp}} -// CHECK: [[TMP0:%.*]] = cir.get_member {{.*}}[1] {name = "d"} : !cir.ptr -> !cir.ptr> +// CHECK: [[TMP0:%.*]] = cir.get_member {{.*}}[1] {name = "d"} : !cir.ptr -> !cir.ptr> // CHECK: [[TMP1:%.*]] = cir.get_bitfield(#bfi_d, [[TMP0]] : !cir.ptr>) -> !s32i // CHECK: [[TMP2:%.*]] = cir.unary(inc, [[TMP1]]) nsw : !s32i, !s32i // CHECK: cir.set_bitfield(#bfi_d, [[TMP0]] : !cir.ptr>, [[TMP2]] : !s32i) @@ -97,7 +97,7 @@ void unOp(S* s) { // CHECK: cir.func {{.*@binOp}} // CHECK: [[TMP0:%.*]] = cir.const #cir.int<42> : !s32i -// CHECK: [[TMP1:%.*]] = cir.get_member {{.*}}[1] {name = "d"} : !cir.ptr -> !cir.ptr> +// CHECK: [[TMP1:%.*]] = cir.get_member {{.*}}[1] {name = "d"} : !cir.ptr -> !cir.ptr> // CHECK: [[TMP2:%.*]] = cir.get_bitfield(#bfi_d, [[TMP1]] : !cir.ptr>) -> !s32i // CHECK: [[TMP3:%.*]] = cir.binop(or, [[TMP2]], [[TMP0]]) : !s32i // CHECK: cir.set_bitfield(#bfi_d, [[TMP1]] : !cir.ptr>, [[TMP3]] : !s32i) @@ -107,7 +107,7 @@ void binOp(S* s) { // CHECK: cir.func {{.*@load_non_bitfield}} -// CHECK: cir.get_member {{%.}}[3] {name = "f"} : !cir.ptr -> !cir.ptr +// CHECK: cir.get_member {{%.}}[3] {name = "f"} : !cir.ptr -> !cir.ptr unsigned load_non_bitfield(S *s) { return s->f; } @@ -125,10 +125,10 @@ void createU() { // for this struct type we create an anon structure with different storage types in initialization // CHECK: cir.func {{.*@createD}} -// CHECK: %0 = cir.alloca !ty_D, !cir.ptr, ["d"] {alignment = 4 : i64} -// CHECK: %1 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr -// CHECK: %2 = cir.const #cir.const_record<{#cir.int<33> : !u8i, #cir.int<0> : !u8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<3> : !s32i}> : !ty_anon_struct -// CHECK: cir.store %2, %1 : !ty_anon_struct, !cir.ptr +// CHECK: %0 = cir.alloca !rec_D, !cir.ptr, ["d"] {alignment = 4 : i64} +// CHECK: %1 = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr +// CHECK: %2 = cir.const #cir.const_record<{#cir.int<33> : !u8i, #cir.int<0> : !u8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<3> : !s32i}> : !rec_anon_struct +// CHECK: cir.store %2, %1 : !rec_anon_struct, !cir.ptr void createD() { D d = {1,2,3}; } @@ -148,13 +148,13 @@ typedef struct { int y ; } G; -// CHECK: cir.global external @g = #cir.const_record<{#cir.int<133> : !u8i, #cir.int<127> : !u8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<254> : !s32i}> : !ty_anon_struct +// CHECK: cir.global external @g = #cir.const_record<{#cir.int<133> : !u8i, #cir.int<127> : !u8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<254> : !s32i}> : !rec_anon_struct G g = { -123, 254UL}; // CHECK: cir.func {{.*@get_y}} -// CHECK: %[[V1:.*]] = cir.get_global @g : !cir.ptr -// CHECK: %[[V2:.*]] = cir.cast(bitcast, %[[V1]] : !cir.ptr), !cir.ptr -// CHECK: %[[V3:.*]] = cir.get_member %[[V2]][1] {name = "y"} : !cir.ptr -> !cir.ptr +// CHECK: %[[V1:.*]] = cir.get_global @g : !cir.ptr +// CHECK: %[[V2:.*]] = cir.cast(bitcast, %[[V1]] : !cir.ptr), !cir.ptr +// CHECK: %[[V3:.*]] = cir.get_member %[[V2]][1] {name = "y"} : !cir.ptr -> !cir.ptr // CHECK: cir.load %[[V3]] : !cir.ptr, !s32i int get_y() { return g.y; diff --git a/clang/test/CIR/CodeGen/bitfields.cpp b/clang/test/CIR/CodeGen/bitfields.cpp index 58e0f26f73cc..5a6b75dfa90e 100644 --- a/clang/test/CIR/CodeGen/bitfields.cpp +++ b/clang/test/CIR/CodeGen/bitfields.cpp @@ -27,15 +27,15 @@ typedef struct { int a : 3; // one bitfield with size < 8 unsigned b; } T; -// CHECK: !ty_T = !cir.record -// CHECK: !ty_anon2E0 = !cir.record -// CHECK: !ty_S = !cir.record, !u16i, !u32i}> -// CHECK: !ty___long = !cir.record}> +// CHECK: !rec_T = !cir.record +// CHECK: !rec_anon2E0 = !cir.record +// CHECK: !rec_S = !cir.record, !u16i, !u32i}> +// CHECK: !rec___long = !cir.record}> // CHECK: cir.func @_Z11store_field -// CHECK: [[TMP0:%.*]] = cir.alloca !ty_S, !cir.ptr +// CHECK: [[TMP0:%.*]] = cir.alloca !rec_S, !cir.ptr // CHECK: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i -// CHECK: [[TMP2:%.*]] = cir.cast(bitcast, [[TMP0]] : !cir.ptr), !cir.ptr +// CHECK: [[TMP2:%.*]] = cir.cast(bitcast, [[TMP0]] : !cir.ptr), !cir.ptr // CHECK: cir.set_bitfield(#bfi_a, [[TMP2]] : !cir.ptr, [[TMP1]] : !s32i) void store_field() { S s; @@ -43,16 +43,16 @@ void store_field() { } // CHECK: cir.func @_Z10load_field -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] -// CHECK: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: [[TMP2:%.*]] = cir.get_member [[TMP1]][1] {name = "d"} : !cir.ptr -> !cir.ptr> +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] +// CHECK: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP2:%.*]] = cir.get_member [[TMP1]][1] {name = "d"} : !cir.ptr -> !cir.ptr> // CHECK: [[TMP3:%.*]] = cir.get_bitfield(#bfi_d, [[TMP2]] : !cir.ptr>) -> !s32i int load_field(S& s) { return s.d; } // CHECK: cir.func @_Z17load_non_bitfield -// CHECK: cir.get_member {{%.}}[3] {name = "f"} : !cir.ptr -> !cir.ptr +// CHECK: cir.get_member {{%.}}[3] {name = "f"} : !cir.ptr -> !cir.ptr unsigned load_non_bitfield(S& s) { return s.f; } diff --git a/clang/test/CIR/CodeGen/bool.c b/clang/test/CIR/CodeGen/bool.c index 7a9655714210..3eaf43f35d07 100644 --- a/clang/test/CIR/CodeGen/bool.c +++ b/clang/test/CIR/CodeGen/bool.c @@ -8,31 +8,31 @@ typedef struct { } S; // CHECK: cir.func @init_bool -// CHECK: [[ALLOC:%.*]] = cir.alloca !ty_S, !cir.ptr -// CHECK: [[ZERO:%.*]] = cir.const #cir.zero : !ty_S -// CHECK: cir.store [[ZERO]], [[ALLOC]] : !ty_S, !cir.ptr +// CHECK: [[ALLOC:%.*]] = cir.alloca !rec_S, !cir.ptr +// CHECK: [[ZERO:%.*]] = cir.const #cir.zero : !rec_S +// CHECK: cir.store [[ZERO]], [[ALLOC]] : !rec_S, !cir.ptr void init_bool(void) { S s = {0}; } // CHECK: cir.func @store_bool -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr> -// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr> +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> // CHECK: [[TMP1:%.*]] = cir.const #cir.int<0> : !s32i // CHECK: [[TMP2:%.*]] = cir.cast(int_to_bool, [[TMP1]] : !s32i), !cir.bool -// CHECK: [[TMP3:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: [[TMP4:%.*]] = cir.get_member [[TMP3]][0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: [[TMP3:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP4:%.*]] = cir.get_member [[TMP3]][0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: cir.store [[TMP2]], [[TMP4]] : !cir.bool, !cir.ptr void store_bool(S *s) { s->x = false; } // CHECK: cir.func @load_bool -// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} +// CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} // CHECK: [[TMP1:%.*]] = cir.alloca !cir.bool, !cir.ptr, ["x", init] {alignment = 1 : i64} -// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> -// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr -// CHECK: [[TMP3:%.*]] = cir.get_member [[TMP2]][0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CHECK: [[TMP3:%.*]] = cir.get_member [[TMP2]][0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: [[TMP4:%.*]] = cir.load [[TMP3]] : !cir.ptr, !cir.bool void load_bool(S *s) { bool x = s->x; diff --git a/clang/test/CIR/CodeGen/build-deferred.cpp b/clang/test/CIR/CodeGen/build-deferred.cpp index f62d8ddc5c99..ceb58684ae77 100644 --- a/clang/test/CIR/CodeGen/build-deferred.cpp +++ b/clang/test/CIR/CodeGen/build-deferred.cpp @@ -24,4 +24,4 @@ void test() { // CHECK-NOT: cir.func linkonce_odr @_ZN6StringC1EPKc // CHECK: cir.func @_Z4testv() -// CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () \ No newline at end of file +// CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/builtin-arm-exclusive.c b/clang/test/CIR/CodeGen/builtin-arm-exclusive.c index da5b3d8a6db7..cf426c646e33 100644 --- a/clang/test/CIR/CodeGen/builtin-arm-exclusive.c +++ b/clang/test/CIR/CodeGen/builtin-arm-exclusive.c @@ -4,7 +4,7 @@ struct twoFldT { char a, b; }; -// CIR: !ty_twoFldT = !cir.record>) -> !s64i sum += __builtin_arm_ldrex((struct twoFldT **)addr)->a; -// CIR: [[INTRES6:%.*]] = cir.llvm.intrinsic "aarch64.ldxr" {{%[0-9]+}} : (!cir.ptr>) -> !s64i -// CIR: [[CAST3:%.*]] = cir.cast(int_to_ptr, [[INTRES6]] : !s64i), !cir.ptr -// CIR: [[MEMBER_A:%.*]] = cir.get_member [[CAST3]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CIR: [[INTRES6:%.*]] = cir.llvm.intrinsic "aarch64.ldxr" {{%[0-9]+}} : (!cir.ptr>) -> !s64i +// CIR: [[CAST3:%.*]] = cir.cast(int_to_ptr, [[INTRES6]] : !s64i), !cir.ptr +// CIR: [[MEMBER_A:%.*]] = cir.get_member [[CAST3]][0] {name = "a"} : !cir.ptr -> !cir.ptr // TODO: Uncomment next 2 lines, add tests when floating result type supported @@ -76,9 +76,9 @@ int test_ldaex(char *addr, long long *addr64, float *addrfloat) { // CIR: [[INTRES5:%.*]] = cir.llvm.intrinsic "aarch64.ldaxr" {{%[0-9]+}} : (!cir.ptr>) -> !s64i sum += __builtin_arm_ldaex((struct twoFldT **)addr)->a; -// CIR: [[INTRES6:%.*]] = cir.llvm.intrinsic "aarch64.ldaxr" {{%[0-9]+}} : (!cir.ptr>) -> !s64i -// CIR: [[CAST3:%.*]] = cir.cast(int_to_ptr, [[INTRES6]] : !s64i), !cir.ptr -// CIR: [[MEMBER_A:%.*]] = cir.get_member [[CAST3]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CIR: [[INTRES6:%.*]] = cir.llvm.intrinsic "aarch64.ldaxr" {{%[0-9]+}} : (!cir.ptr>) -> !s64i +// CIR: [[CAST3:%.*]] = cir.cast(int_to_ptr, [[INTRES6]] : !s64i), !cir.ptr +// CIR: [[MEMBER_A:%.*]] = cir.get_member [[CAST3]][0] {name = "a"} : !cir.ptr -> !cir.ptr // TODO: Uncomment next 2 lines, add tests when floating result type supported diff --git a/clang/test/CIR/CodeGen/builtin-bit-cast.cpp b/clang/test/CIR/CodeGen/builtin-bit-cast.cpp index c8d26106b7d9..313387f9f536 100644 --- a/clang/test/CIR/CodeGen/builtin-bit-cast.cpp +++ b/clang/test/CIR/CodeGen/builtin-bit-cast.cpp @@ -28,8 +28,8 @@ unsigned long test_aggregate_to_scalar(two_ints &ti) { } // CIR-LABEL: cir.func @_Z24test_aggregate_to_scalarR8two_ints -// CIR: %[[#SRC_PTR:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr -// CIR-NEXT: %[[#DST_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr +// CIR: %[[#SRC_PTR:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr +// CIR-NEXT: %[[#DST_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr // CIR-NEXT: %{{.+}} = cir.load %[[#DST_PTR]] : !cir.ptr, !u64i // CIR: } @@ -48,9 +48,9 @@ two_floats test_aggregate_record(two_ints& ti) { } // CIR-LABEL: cir.func @_Z21test_aggregate_recordR8two_ints -// CIR: %[[#SRC_PTR:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr -// CIR-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr -// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr +// CIR: %[[#SRC_PTR:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr +// CIR-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr +// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#SIZE:]] = cir.const #cir.int<8> : !u64i // CIR-NEXT: cir.libc.memcpy %[[#SIZE]] bytes from %[[#SRC_VOID_PTR]] to %[[#DST_VOID_PTR]] : !u64i, !cir.ptr -> !cir.ptr // CIR: } @@ -69,7 +69,7 @@ two_floats test_aggregate_array(int (&ary)[2]) { // CIR-LABEL: cir.func @_Z20test_aggregate_arrayRA2_i // CIR: %[[#SRC_PTR:]] = cir.load %{{.+}} : !cir.ptr>>, !cir.ptr> // CIR-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr>), !cir.ptr -// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr +// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#SIZE:]] = cir.const #cir.int<8> : !u64i // CIR-NEXT: cir.libc.memcpy %[[#SIZE]] bytes from %[[#SRC_VOID_PTR]] to %[[#DST_VOID_PTR]] : !u64i, !cir.ptr -> !cir.ptr // CIR: } @@ -87,7 +87,7 @@ two_ints test_scalar_to_aggregate(unsigned long ul) { // CIR-LABEL: cir.func @_Z24test_scalar_to_aggregatem // CIR: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr -// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr +// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#SIZE:]] = cir.const #cir.int<8> : !u64i // CIR-NEXT: cir.libc.memcpy %[[#SIZE]] bytes from %[[#SRC_VOID_PTR]] to %[[#DST_VOID_PTR]] : !u64i, !cir.ptr -> !cir.ptr // CIR: } @@ -123,7 +123,7 @@ two_ints test_rvalue_aggregate() { // CIR-NEXT: %[[#A:]] = cir.const #cir.int<42> : !u64i // CIR-NEXT: cir.store %[[#A]], %[[#TMP_SLOT]] : !u64i, !cir.ptr // CIR-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#TMP_SLOT]] : !cir.ptr), !cir.ptr -// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr +// CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %0 : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#SIZE:]] = cir.const #cir.int<8> : !u64i // CIR-NEXT: cir.libc.memcpy %[[#SIZE]] bytes from %[[#SRC_VOID_PTR]] to %[[#DST_VOID_PTR]] : !u64i, !cir.ptr -> !cir.ptr // CIR-NEXT: } diff --git a/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp b/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp index 02ea747b5b83..3993f4bfd49b 100644 --- a/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp +++ b/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp @@ -16,13 +16,13 @@ class f { const char *f::b() { return g.b(h); } void fn1() { f f1; } -// CIR: ty_a = !cir.record -// CIR: ty_f = !cir.record +// CIR: !rec_a = !cir.record +// CIR: !rec_f = !cir.record // CIR: cir.global external @h = #cir.int<0> // CIR: cir.func private @_ZN1a1bEi(!s32i) -> !cir.ptr -// CIR: cir.func @_ZN1f1bEv(%arg0: !cir.ptr loc{{.*}}) -> !cir.ptr +// CIR: cir.func @_ZN1f1bEv(%arg0: !cir.ptr loc{{.*}}) -> !cir.ptr // CIR: [[H_PTR:%.*]] = cir.get_global @h : !cir.ptr loc(#loc18) // CIR: [[H_VAL:%.*]] = cir.load [[H_PTR]] : !cir.ptr, !s32i // CIR: [[RET1_VAL:%.*]] = cir.call @_ZN1a1bEi([[H_VAL]]) : (!s32i) -> !cir.ptr @@ -32,7 +32,7 @@ void fn1() { f f1; } // CIR: cir.return [[RET1_VAL2]] : !cir.ptr // CIR: cir.func @_Z3fn1v() -// CIR: [[CLS_F:%.*]] = cir.alloca !ty_f, !cir.ptr, ["f1"] {alignment = 1 : i64} +// CIR: [[CLS_F:%.*]] = cir.alloca !rec_f, !cir.ptr, ["f1"] {alignment = 1 : i64} // CIR: cir.return // LLVM: %class.f = type { %class.a } diff --git a/clang/test/CIR/CodeGen/cast.c b/clang/test/CIR/CodeGen/cast.c index 710b065f8087..d261246d37fc 100644 --- a/clang/test/CIR/CodeGen/cast.c +++ b/clang/test/CIR/CodeGen/cast.c @@ -8,11 +8,11 @@ int cstyle_cast_lvalue(A a) { return ((A)(a)).x; } -// CHECK: cir.func @cstyle_cast_lvalue(%arg0: !ty_A loc({{.*}})) -// CHECK: [[ALLOC_A:%.*]] = cir.alloca !ty_A, !cir.ptr, ["a", init] {alignment = 4 : i64} +// CHECK: cir.func @cstyle_cast_lvalue(%arg0: !rec_A loc({{.*}})) +// CHECK: [[ALLOC_A:%.*]] = cir.alloca !rec_A, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK: [[ALLOC_RET:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: cir.store %arg0, [[ALLOC_A]] : !ty_A, !cir.ptr -// CHECK: [[X_ADDR:%.*]] = cir.get_member [[ALLOC_A]][0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: cir.store %arg0, [[ALLOC_A]] : !rec_A, !cir.ptr +// CHECK: [[X_ADDR:%.*]] = cir.get_member [[ALLOC_A]][0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: [[X:%.*]] = cir.load [[X_ADDR]] : !cir.ptr, !s32i // CHECK: cir.store [[X]], [[ALLOC_RET]] : !s32i, !cir.ptr // CHECK: [[RET:%.*]] = cir.load [[ALLOC_RET]] : !cir.ptr, !s32i diff --git a/clang/test/CIR/CodeGen/cast.cpp b/clang/test/CIR/CodeGen/cast.cpp index b5d1d8e4f43f..85d14621aa19 100644 --- a/clang/test/CIR/CodeGen/cast.cpp +++ b/clang/test/CIR/CodeGen/cast.cpp @@ -129,8 +129,8 @@ void null_cast(long ptr) { // CHECK: cir.func @_Z9null_castl // CHECK: %[[ADDR:[0-9]+]] = cir.const #cir.ptr : !cir.ptr // CHECK: cir.store %{{[0-9]+}}, %[[ADDR]] : !s32i, !cir.ptr -// CHECK: %[[BASE:[0-9]+]] = cir.const #cir.ptr : !cir.ptr -// CHECK: %[[FIELD:[0-9]+]] = cir.get_member %[[BASE]][0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: %[[BASE:[0-9]+]] = cir.const #cir.ptr : !cir.ptr +// CHECK: %[[FIELD:[0-9]+]] = cir.get_member %[[BASE]][0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: cir.store %{{[0-9]+}}, %[[FIELD]] : !s32i, !cir.ptr void int_cast(long ptr) { @@ -138,7 +138,7 @@ void int_cast(long ptr) { } // CHECK: cir.func @_Z8int_castl -// CHECK: %[[BASE:[0-9]+]] = cir.cast(int_to_ptr, %{{[0-9]+}} : !u64i), !cir.ptr -// CHECK: %[[FIELD:[0-9]+]] = cir.get_member %[[BASE]][0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: %[[BASE:[0-9]+]] = cir.cast(int_to_ptr, %{{[0-9]+}} : !u64i), !cir.ptr +// CHECK: %[[FIELD:[0-9]+]] = cir.get_member %[[BASE]][0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: cir.store %{{[0-9]+}}, %[[FIELD]] : !s32i, !cir.ptr diff --git a/clang/test/CIR/CodeGen/compound-literal.c b/clang/test/CIR/CodeGen/compound-literal.c index b3881f4c69ff..845f706df174 100644 --- a/clang/test/CIR/CodeGen/compound-literal.c +++ b/clang/test/CIR/CodeGen/compound-literal.c @@ -13,7 +13,7 @@ S a = { }; // CIR: cir.global "private" internal @".compoundLiteral.0" = #cir.zero : !cir.array {alignment = 4 : i64} -// CIR: cir.global external @a = #cir.const_record<{#cir.global_view<@".compoundLiteral.0"> : !cir.ptr}> : !ty_S +// CIR: cir.global external @a = #cir.const_record<{#cir.global_view<@".compoundLiteral.0"> : !cir.ptr}> : !rec_S // LLVM: @.compoundLiteral.0 = internal global [0 x i32] zeroinitializer // LLVM: @a = global %struct.S { ptr @.compoundLiteral.0 } @@ -23,7 +23,7 @@ S b = { }; // CIR: cir.global "private" internal @".compoundLiteral.1" = #cir.const_array<[#cir.int<1> : !s32i]> : !cir.array {alignment = 4 : i64} -// CIR: cir.global external @b = #cir.const_record<{#cir.global_view<@".compoundLiteral.1"> : !cir.ptr}> : !ty_S +// CIR: cir.global external @b = #cir.const_record<{#cir.global_view<@".compoundLiteral.1"> : !cir.ptr}> : !rec_S // LLVM: @.compoundLiteral.1 = internal global [1 x i32] [i32 1] // LLVM: @b = global %struct.S { ptr @.compoundLiteral.1 } @@ -37,8 +37,8 @@ int foo() { // CIR: cir.func no_proto @foo() -> !s32i // CIR: [[RET_MEM:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CIR: [[COMPLITERAL_MEM:%.*]] = cir.alloca !ty_anon2E0, !cir.ptr, [".compoundliteral"] {alignment = 4 : i64} -// CIR: [[FIELD:%.*]] = cir.get_member [[COMPLITERAL_MEM]][0] {name = "i"} : !cir.ptr -> !cir.ptr +// CIR: [[COMPLITERAL_MEM:%.*]] = cir.alloca !rec_anon2E0, !cir.ptr, [".compoundliteral"] {alignment = 4 : i64} +// CIR: [[FIELD:%.*]] = cir.get_member [[COMPLITERAL_MEM]][0] {name = "i"} : !cir.ptr -> !cir.ptr // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i // CIR: cir.store [[ONE]], [[FIELD]] : !s32i, !cir.ptr // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i @@ -52,7 +52,7 @@ struct G g(int x, int y, int z) { } // CIR: cir.func @g -// CIR: %[[RETVAL:.*]] = cir.alloca !ty_G, !cir.ptr, ["__retval"] {alignment = 2 : i64} +// CIR: %[[RETVAL:.*]] = cir.alloca !rec_G, !cir.ptr, ["__retval"] {alignment = 2 : i64} // CIR: %[[X:.*]] = cir.get_member %[[RETVAL]][0] {name = "x"} // CIR: cir.store {{.*}}, %[[X]] : !s16i // CIR: %[[Y:.*]] = cir.get_member %[[RETVAL]][1] {name = "y"} @@ -74,21 +74,21 @@ void split_large_page(unsigned long addr, pgprot_t prot) // CIR-LABEL: @split_large_page // CIR: %[[VAL_2:.*]] = cir.alloca !u64i, !cir.ptr, ["addr", init] {alignment = 8 : i64} -// CIR: %[[VAL_3:.*]] = cir.alloca !ty_pgprot_t, !cir.ptr, ["prot", init] {alignment = 8 : i64} -// CIR: %[[VAL_4:.*]] = cir.alloca !ty_pgprot_t, !cir.ptr, ["tmp"] {alignment = 8 : i64} +// CIR: %[[VAL_3:.*]] = cir.alloca !rec_pgprot_t, !cir.ptr, ["prot", init] {alignment = 8 : i64} +// CIR: %[[VAL_4:.*]] = cir.alloca !rec_pgprot_t, !cir.ptr, ["tmp"] {alignment = 8 : i64} // CIR: cir.store {{.*}}, %[[VAL_2]] : !u64i, !cir.ptr -// CIR: cir.store {{.*}}, %[[VAL_3]] : !ty_pgprot_t, !cir.ptr +// CIR: cir.store {{.*}}, %[[VAL_3]] : !rec_pgprot_t, !cir.ptr // CIR: %[[VAL_5:.*]] = cir.load %[[VAL_2]] : !cir.ptr, !u64i // CIR: %[[VAL_6:.*]] = cir.cast(int_to_bool, %[[VAL_5]] : !u64i), !cir.bool // CIR: cir.if %[[VAL_6]] { -// CIR: cir.copy %[[VAL_3]] to %[[VAL_4]] : !cir.ptr +// CIR: cir.copy %[[VAL_3]] to %[[VAL_4]] : !cir.ptr // CIR: } else { -// CIR: %[[VAL_7:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr -> !cir.ptr +// CIR: %[[VAL_7:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr -> !cir.ptr // CIR: %[[VAL_8:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[VAL_9:.*]] = cir.cast(integral, %[[VAL_8]] : !s32i), !u64i // CIR: cir.store %[[VAL_9]], %[[VAL_7]] : !u64i, !cir.ptr // CIR: } -// CIR: %[[VAL_10:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr -> !cir.ptr +// CIR: %[[VAL_10:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr -> !cir.ptr // CIR: %[[VAL_11:.*]] = cir.load %[[VAL_10]] : !cir.ptr, !u64i // CIR: cir.return // CIR: } diff --git a/clang/test/CIR/CodeGen/cond.cpp b/clang/test/CIR/CodeGen/cond.cpp index aea901a8ee9d..ae8e0dc6be56 100644 --- a/clang/test/CIR/CodeGen/cond.cpp +++ b/clang/test/CIR/CodeGen/cond.cpp @@ -17,11 +17,11 @@ min(const unsigned long& __a, const unsigned long& __b) { // CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> // CHECK: cir.scope { -// CHECK: %4 = cir.alloca !ty___less, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} -// CHECK: cir.call @_ZN6__lessC1Ev(%4) : (!cir.ptr) -> () +// CHECK: %4 = cir.alloca !rec___less, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} +// CHECK: cir.call @_ZN6__lessC1Ev(%4) : (!cir.ptr) -> () // CHECK: %5 = cir.load %1 : !cir.ptr>, !cir.ptr // CHECK: %6 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK: %7 = cir.call @_ZNK6__lessclERKmS1_(%4, %5, %6) : (!cir.ptr, !cir.ptr, !cir.ptr) -> !cir.bool +// CHECK: %7 = cir.call @_ZNK6__lessclERKmS1_(%4, %5, %6) : (!cir.ptr, !cir.ptr, !cir.ptr) -> !cir.bool // CHECK: %8 = cir.ternary(%7, true { // CHECK: %9 = cir.load %1 : !cir.ptr>, !cir.ptr // CHECK: cir.yield %9 : !cir.ptr diff --git a/clang/test/CIR/CodeGen/conditional-cleanup.cpp b/clang/test/CIR/CodeGen/conditional-cleanup.cpp index eadbb2307ad4..1ed3c3c6473c 100644 --- a/clang/test/CIR/CodeGen/conditional-cleanup.cpp +++ b/clang/test/CIR/CodeGen/conditional-cleanup.cpp @@ -86,13 +86,13 @@ namespace test7 { // CIR_EH-DAG: #[[$ATTR_3:.+]] = #cir.bool : !cir.bool // CIR_EH-LABEL: @_ZN5test74testEv -// CIR_EH: %[[VAL_0:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} +// CIR_EH: %[[VAL_0:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} // CIR_EH: cir.scope { // CIR_EH: %[[VAL_1:.*]] = cir.alloca !cir.bool, !cir.ptr, ["cleanup.cond"] {alignment = 1 : i64} -// CIR_EH: %[[VAL_2:.*]] = cir.alloca !ty_test73A3AA, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} +// CIR_EH: %[[VAL_2:.*]] = cir.alloca !rec_test73A3AA, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} // CIR_EH: %[[VAL_3:.*]] = cir.alloca !cir.bool, !cir.ptr, ["cleanup.cond"] {alignment = 1 : i64} // CIR_EH: %[[VAL_4:.*]] = cir.alloca !cir.bool, !cir.ptr, ["cleanup.cond"] {alignment = 1 : i64} -// CIR_EH: %[[VAL_5:.*]] = cir.alloca !ty_test73A3AA, !cir.ptr, ["ref.tmp1"] {alignment = 1 : i64} +// CIR_EH: %[[VAL_5:.*]] = cir.alloca !rec_test73A3AA, !cir.ptr, ["ref.tmp1"] {alignment = 1 : i64} // CIR_EH: %[[VAL_6:.*]] = cir.alloca !cir.bool, !cir.ptr, ["cleanup.cond"] {alignment = 1 : i64} // CIR_EH: %[[VAL_7:.*]] = cir.const #[[$ATTR_0]] // CIR_EH: %[[VAL_8:.*]] = cir.const #[[$ATTR_3]] @@ -106,7 +106,7 @@ namespace test7 { // CIR_EH: %[[VAL_16:.*]] = cir.call @_ZN5test71BnwEm(%[[VAL_15]]) : (!u64i) -> !cir.ptr // CIR_EH: %[[VAL_17:.*]] = cir.const #{{.*}} : !cir.ptr // CIR_EH: %[[VAL_18:.*]] = cir.cmp(ne, %[[VAL_16]], %[[VAL_17]]) : !cir.ptr, !cir.bool -// CIR_EH: %[[VAL_19:.*]] = cir.cast(bitcast, %[[VAL_16]] : !cir.ptr), !cir.ptr +// CIR_EH: %[[VAL_19:.*]] = cir.cast(bitcast, %[[VAL_16]] : !cir.ptr), !cir.ptr // CIR_EH: cir.store align(1) %[[VAL_13]], %[[VAL_1]] : !cir.bool, !cir.ptr // CIR_EH: cir.store align(1) %[[VAL_11]], %[[VAL_3]] : !cir.bool, !cir.ptr // CIR_EH: cir.store align(1) %[[VAL_9]], %[[VAL_4]] : !cir.bool, !cir.ptr @@ -114,7 +114,7 @@ namespace test7 { // CIR_EH: cir.if %[[VAL_18]] { // CIR_EH: cir.store %[[VAL_14]], %[[VAL_1]] : !cir.bool, !cir.ptr // CIR_EH: cir.try synthetic cleanup { -// CIR_EH: cir.call exception @_ZN5test71AC1Ev(%[[VAL_2]]) : (!cir.ptr) -> () cleanup { +// CIR_EH: cir.call exception @_ZN5test71AC1Ev(%[[VAL_2]]) : (!cir.ptr) -> () cleanup { // CIR_EH: %[[VAL_20:.*]] = cir.load %[[VAL_1]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_20]] { // CIR_EH: cir.call @_ZdlPvm(%[[VAL_16]], %[[VAL_15]]) : (!cir.ptr, !u64i) -> () @@ -130,18 +130,18 @@ namespace test7 { // CIR_EH: %[[VAL_22:.*]] = cir.call @_ZN5test71BnwEm(%[[VAL_21]]) : (!u64i) -> !cir.ptr // CIR_EH: %[[VAL_23:.*]] = cir.const #{{.*}} : !cir.ptr // CIR_EH: %[[VAL_24:.*]] = cir.cmp(ne, %[[VAL_22]], %[[VAL_23]]) : !cir.ptr, !cir.bool -// CIR_EH: %[[VAL_25:.*]] = cir.cast(bitcast, %[[VAL_22]] : !cir.ptr), !cir.ptr +// CIR_EH: %[[VAL_25:.*]] = cir.cast(bitcast, %[[VAL_22]] : !cir.ptr), !cir.ptr // CIR_EH: cir.if %[[VAL_24]] { // CIR_EH: cir.store %[[VAL_10]], %[[VAL_4]] : !cir.bool, !cir.ptr // CIR_EH: cir.try synthetic cleanup { -// CIR_EH: cir.call exception @_ZN5test71AC1Ev(%[[VAL_5]]) : (!cir.ptr) -> () cleanup { +// CIR_EH: cir.call exception @_ZN5test71AC1Ev(%[[VAL_5]]) : (!cir.ptr) -> () cleanup { // CIR_EH: %[[VAL_26:.*]] = cir.load %[[VAL_4]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_26]] { // CIR_EH: cir.call @_ZdlPvm(%[[VAL_22]], %[[VAL_21]]) : (!cir.ptr, !u64i) -> () // CIR_EH: } // CIR_EH: %[[VAL_27:.*]] = cir.load %[[VAL_3]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_27]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_28:.*]] = cir.load %[[VAL_1]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_28]] { @@ -154,12 +154,12 @@ namespace test7 { // CIR_EH: cir.resume // CIR_EH: }] // CIR_EH: cir.store %[[VAL_8]], %[[VAL_6]] : !cir.bool, !cir.ptr -// CIR_EH: %[[VAL_29:.*]] = cir.const #{{.*}} : !cir.ptr +// CIR_EH: %[[VAL_29:.*]] = cir.const #{{.*}} : !cir.ptr // CIR_EH: cir.try synthetic cleanup { -// CIR_EH: cir.call exception @_ZN5test71BC1ERKNS_1AEPS0_(%[[VAL_25]], %[[VAL_5]], %[[VAL_29]]) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { +// CIR_EH: cir.call exception @_ZN5test71BC1ERKNS_1AEPS0_(%[[VAL_25]], %[[VAL_5]], %[[VAL_29]]) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { // CIR_EH: %[[VAL_30:.*]] = cir.load %[[VAL_6]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_30]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_5]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_5]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_31:.*]] = cir.load %[[VAL_4]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_31]] { @@ -167,7 +167,7 @@ namespace test7 { // CIR_EH: } // CIR_EH: %[[VAL_32:.*]] = cir.load %[[VAL_3]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_32]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_33:.*]] = cir.load %[[VAL_1]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_33]] { @@ -183,10 +183,10 @@ namespace test7 { // CIR_EH: cir.store %[[VAL_34]], %[[VAL_4]] : !cir.bool, !cir.ptr // CIR_EH: } // CIR_EH: cir.try synthetic cleanup { -// CIR_EH: cir.call exception @_ZN5test71BC1ERKNS_1AEPS0_(%[[VAL_19]], %[[VAL_2]], %[[VAL_25]]) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { +// CIR_EH: cir.call exception @_ZN5test71BC1ERKNS_1AEPS0_(%[[VAL_19]], %[[VAL_2]], %[[VAL_25]]) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { // CIR_EH: %[[VAL_35:.*]] = cir.load %[[VAL_6]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_35]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_5]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_5]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_36:.*]] = cir.load %[[VAL_4]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_36]] { @@ -194,7 +194,7 @@ namespace test7 { // CIR_EH: } // CIR_EH: %[[VAL_37:.*]] = cir.load %[[VAL_3]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_37]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_38:.*]] = cir.load %[[VAL_1]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_38]] { @@ -209,26 +209,26 @@ namespace test7 { // CIR_EH: %[[VAL_39:.*]] = cir.const #[[$ATTR_0]] // CIR_EH: cir.store %[[VAL_39]], %[[VAL_1]] : !cir.bool, !cir.ptr // CIR_EH: } -// CIR_EH: cir.store %[[VAL_19]], %[[VAL_0]] : !cir.ptr, !cir.ptr> +// CIR_EH: cir.store %[[VAL_19]], %[[VAL_0]] : !cir.ptr, !cir.ptr> // CIR_EH: %[[VAL_40:.*]] = cir.load %[[VAL_6]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_40]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_5]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_5]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_41:.*]] = cir.load %[[VAL_3]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_41]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_42:.*]] = cir.load %[[VAL_3]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_42]] { -// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () +// CIR_EH: cir.call @_ZN5test71AD1Ev(%[[VAL_2]]) : (!cir.ptr) -> () // CIR_EH: } // CIR_EH: %[[VAL_43:.*]] = cir.load %[[VAL_1]] : !cir.ptr, !cir.bool // CIR_EH: cir.if %[[VAL_43]] { // CIR_EH: cir.call @_ZdlPvm(%[[VAL_16]], %[[VAL_15]]) : (!cir.ptr, !u64i) -> () // CIR_EH: } // CIR_EH: } -// CIR_EH: %[[VAL_44:.*]] = cir.load %[[VAL_0]] : !cir.ptr>, !cir.ptr -// CIR_EH: cir.return %[[VAL_44]] : !cir.ptr +// CIR_EH: %[[VAL_44:.*]] = cir.load %[[VAL_0]] : !cir.ptr>, !cir.ptr +// CIR_EH: cir.return %[[VAL_44]] : !cir.ptr // CIR_EH: } // Nothing special, just test it passes! diff --git a/clang/test/CIR/CodeGen/const-alloca.cpp b/clang/test/CIR/CodeGen/const-alloca.cpp index cd64a91ecf5d..412f61acb072 100644 --- a/clang/test/CIR/CodeGen/const-alloca.cpp +++ b/clang/test/CIR/CodeGen/const-alloca.cpp @@ -51,7 +51,7 @@ void local_const_struct() { } // CIR-LABEL: @_Z18local_const_structv -// CIR: %{{.+}} = cir.alloca !ty_Foo, !cir.ptr, ["x", init, const] +// CIR: %{{.+}} = cir.alloca !rec_Foo, !cir.ptr, ["x", init, const] // CIR: } [[clang::optnone]] diff --git a/clang/test/CIR/CodeGen/const-baseclass.cpp b/clang/test/CIR/CodeGen/const-baseclass.cpp index 5f2669bfe23f..3aee613d3fe3 100644 --- a/clang/test/CIR/CodeGen/const-baseclass.cpp +++ b/clang/test/CIR/CodeGen/const-baseclass.cpp @@ -14,7 +14,7 @@ void f() { } // CHECK-LABEL: @_ZN1BC2Ev -// CHECK: %[[A:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr -// CHECK: cir.call @_ZN1AC2Ev(%[[A:.*]]) : (!cir.ptr) -> () -// CHECK: %[[BASE:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr -// CHECK: cir.call @_ZN5EmptyC2Ev(%[[BASE]]) : (!cir.ptr) -> () \ No newline at end of file +// CHECK: %[[A:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr +// CHECK: cir.call @_ZN1AC2Ev(%[[A:.*]]) : (!cir.ptr) -> () +// CHECK: %[[BASE:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr +// CHECK: cir.call @_ZN5EmptyC2Ev(%[[BASE]]) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/const-bitfields.c b/clang/test/CIR/CodeGen/const-bitfields.c index ae07bf5ed90c..f31a34e74240 100644 --- a/clang/test/CIR/CodeGen/const-bitfields.c +++ b/clang/test/CIR/CodeGen/const-bitfields.c @@ -14,23 +14,23 @@ struct Inner { unsigned d : 30; }; -// CHECK: !ty_anon_struct = !cir.record -// CHECK: !ty_T = !cir.record, !s32i} #cir.record.decl.ast> -// CHECK: !ty_anon_struct1 = !cir.record, !u8i, !u8i, !u8i, !u8i}> +// CHECK: !rec_anon_struct = !cir.record +// CHECK: !rec_T = !cir.record, !s32i} #cir.record.decl.ast> +// CHECK: !rec_anon_struct1 = !cir.record, !u8i, !u8i, !u8i, !u8i}> // CHECK: #bfi_Z = #cir.bitfield_info, size = 9, offset = 11, is_signed = true> struct T GV = { 1, 5, 26, 42 }; -// CHECK: cir.global external @GV = #cir.const_record<{#cir.int<161> : !u8i, #cir.int<208> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<42> : !s32i}> : !ty_anon_struct +// CHECK: cir.global external @GV = #cir.const_record<{#cir.int<161> : !u8i, #cir.int<208> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<42> : !s32i}> : !rec_anon_struct // check padding is used (const array of zeros) struct Inner var = { 1, 0, 1, 21}; -// CHECK: cir.global external @var = #cir.const_record<{#cir.int<5> : !u8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<21> : !u8i, #cir.int<0> : !u8i, #cir.int<0> : !u8i, #cir.int<0> : !u8i}> : !ty_anon_struct1 +// CHECK: cir.global external @var = #cir.const_record<{#cir.int<5> : !u8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<21> : !u8i, #cir.int<0> : !u8i, #cir.int<0> : !u8i, #cir.int<0> : !u8i}> : !rec_anon_struct1 // CHECK: cir.func {{.*@getZ()}} -// CHECK: %1 = cir.get_global @GV : !cir.ptr -// CHECK: %2 = cir.cast(bitcast, %1 : !cir.ptr), !cir.ptr -// CHECK: %3 = cir.cast(bitcast, %2 : !cir.ptr), !cir.ptr> +// CHECK: %1 = cir.get_global @GV : !cir.ptr +// CHECK: %2 = cir.cast(bitcast, %1 : !cir.ptr), !cir.ptr +// CHECK: %3 = cir.cast(bitcast, %2 : !cir.ptr), !cir.ptr> // CHECK: %4 = cir.get_bitfield(#bfi_Z, %3 : !cir.ptr>) -> !s32i int getZ() { return GV.Z; @@ -38,9 +38,9 @@ int getZ() { // check the type used is the type of T struct for plain field // CHECK: cir.func {{.*@getW()}} -// CHECK: %1 = cir.get_global @GV : !cir.ptr -// CHECK: %2 = cir.cast(bitcast, %1 : !cir.ptr), !cir.ptr -// CHECK: %3 = cir.get_member %2[1] {name = "W"} : !cir.ptr -> !cir.ptr +// CHECK: %1 = cir.get_global @GV : !cir.ptr +// CHECK: %2 = cir.cast(bitcast, %1 : !cir.ptr), !cir.ptr +// CHECK: %3 = cir.get_member %2[1] {name = "W"} : !cir.ptr -> !cir.ptr int getW() { return GV.W; } diff --git a/clang/test/CIR/CodeGen/copy-constructor.cpp b/clang/test/CIR/CodeGen/copy-constructor.cpp index 8c6475d642e1..a7a97ea2d0c3 100644 --- a/clang/test/CIR/CodeGen/copy-constructor.cpp +++ b/clang/test/CIR/CodeGen/copy-constructor.cpp @@ -9,8 +9,8 @@ struct HasScalarArrayMember { }; // CIR-LABEL: cir.func @_ZN20HasScalarArrayMemberC2ERKS_( -// CIR-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr -// CIR-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr +// CIR-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr +// CIR-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr // CIR-NEXT: cir.store %arg0, %[[#THIS]] // CIR-NEXT: cir.store %arg1, %[[#OTHER]] // CIR-NEXT: %[[#THIS_LOAD:]] = cir.load %[[#THIS]] diff --git a/clang/test/CIR/CodeGen/coro-task.cpp b/clang/test/CIR/CodeGen/coro-task.cpp index e9ba7007bb4e..ff745123e032 100644 --- a/clang/test/CIR/CodeGen/coro-task.cpp +++ b/clang/test/CIR/CodeGen/coro-task.cpp @@ -130,12 +130,12 @@ co_invoke_fn co_invoke; // CHECK-DAG: ![[VoidTask:.*]] = !cir.record" padded {!u8i}> // CHECK-DAG: ![[VoidPromisse:.*]] = !cir.record::promise_type" padded {!u8i}> // CHECK-DAG: ![[CoroHandleVoid:.*]] = !cir.record" padded {!u8i}> -// CHECK-DAG: ![[CoroHandlePromise:ty_.*]] = !cir.record::promise_type>" padded {!u8i}> +// CHECK-DAG: ![[CoroHandlePromise:rec_.*]] = !cir.record::promise_type>" padded {!u8i}> // CHECK-DAG: ![[StdString:.*]] = !cir.record // CHECK-DAG: ![[SuspendAlways:.*]] = !cir.record // CHECK: module {{.*}} { -// CHECK-NEXT: cir.global external @_ZN5folly4coro9co_invokeE = #cir.zero : !ty_folly3A3Acoro3A3Aco_invoke_fn +// CHECK-NEXT: cir.global external @_ZN5folly4coro9co_invokeE = #cir.zero : !rec_folly3A3Acoro3A3Aco_invoke_fn // CHECK: cir.func builtin private @__builtin_coro_id(!u32i, !cir.ptr, !cir.ptr, !cir.ptr) -> !u32i // CHECK: cir.func builtin private @__builtin_coro_alloc(!u32i) -> !cir.bool @@ -356,10 +356,10 @@ folly::coro::Task go4() { // CHECK: } // CHECK: %12 = cir.scope { -// CHECK: %17 = cir.alloca !ty_anon2E2, !cir.ptr, ["ref.tmp1"] {alignment = 1 : i64} +// CHECK: %17 = cir.alloca !rec_anon2E2, !cir.ptr, ["ref.tmp1"] {alignment = 1 : i64} // Get the lambda invoker ptr via `lambda operator folly::coro::Task (*)(int const&)()` -// CHECK: %18 = cir.call @_ZZ3go4vENK3$_0cvPFN5folly4coro4TaskIiEERKiEEv(%17) : (!cir.ptr) -> !cir.ptr) -> ![[IntTask]]>> +// CHECK: %18 = cir.call @_ZZ3go4vENK3$_0cvPFN5folly4coro4TaskIiEERKiEEv(%17) : (!cir.ptr) -> !cir.ptr) -> ![[IntTask]]>> // CHECK: %19 = cir.unary(plus, %18) : !cir.ptr) -> ![[IntTask]]>>, !cir.ptr) -> ![[IntTask]]>> // CHECK: cir.yield %19 : !cir.ptr) -> ![[IntTask]]>> // CHECK: } @@ -387,7 +387,7 @@ folly::coro::Task yield1() { co_yield t; } -// CHECK: cir.func coroutine @_Z6yield1v() -> !ty_folly3A3Acoro3A3ATask3Cvoid3E +// CHECK: cir.func coroutine @_Z6yield1v() -> !rec_folly3A3Acoro3A3ATask3Cvoid3E // CHECK: cir.await(init, ready : { // CHECK: }, suspend : { @@ -395,30 +395,30 @@ folly::coro::Task yield1() { // CHECK: },) // CHECK: cir.scope { -// CHECK-NEXT: %[[#SUSPEND_PTR:]] = cir.alloca !ty_std3A3Asuspend_always, !cir.ptr -// CHECK-NEXT: %[[#AWAITER_PTR:]] = cir.alloca !ty_folly3A3Acoro3A3ATask3Cvoid3E, !cir.ptr -// CHECK-NEXT: %[[#CORO_PTR:]] = cir.alloca !ty_std3A3Acoroutine_handle3Cvoid3E, !cir.ptr -// CHECK-NEXT: %[[#CORO2_PTR:]] = cir.alloca !ty_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E, !cir.ptr -// CHECK-NEXT: cir.call @_ZN5folly4coro4TaskIvEC1ERKS2_(%[[#AWAITER_PTR]], %{{.+}}) : (!cir.ptr, !cir.ptr) -> () -// CHECK-NEXT: %[[#AWAITER:]] = cir.load %[[#AWAITER_PTR]] : !cir.ptr, !ty_folly3A3Acoro3A3ATask3Cvoid3E -// CHECK-NEXT: %[[#SUSPEND:]] = cir.call @_ZN5folly4coro4TaskIvE12promise_type11yield_valueES2_(%{{.+}}, %[[#AWAITER]]) : (!cir.ptr, !ty_folly3A3Acoro3A3ATask3Cvoid3E) -> !ty_std3A3Asuspend_always -// CHECK-NEXT: cir.store %[[#SUSPEND]], %[[#SUSPEND_PTR]] : !ty_std3A3Asuspend_always, !cir.ptr +// CHECK-NEXT: %[[#SUSPEND_PTR:]] = cir.alloca !rec_std3A3Asuspend_always, !cir.ptr +// CHECK-NEXT: %[[#AWAITER_PTR:]] = cir.alloca !rec_folly3A3Acoro3A3ATask3Cvoid3E, !cir.ptr +// CHECK-NEXT: %[[#CORO_PTR:]] = cir.alloca !rec_std3A3Acoroutine_handle3Cvoid3E, !cir.ptr +// CHECK-NEXT: %[[#CORO2_PTR:]] = cir.alloca !rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E, !cir.ptr +// CHECK-NEXT: cir.call @_ZN5folly4coro4TaskIvEC1ERKS2_(%[[#AWAITER_PTR]], %{{.+}}) : (!cir.ptr, !cir.ptr) -> () +// CHECK-NEXT: %[[#AWAITER:]] = cir.load %[[#AWAITER_PTR]] : !cir.ptr, !rec_folly3A3Acoro3A3ATask3Cvoid3E +// CHECK-NEXT: %[[#SUSPEND:]] = cir.call @_ZN5folly4coro4TaskIvE12promise_type11yield_valueES2_(%{{.+}}, %[[#AWAITER]]) : (!cir.ptr, !rec_folly3A3Acoro3A3ATask3Cvoid3E) -> !rec_std3A3Asuspend_always +// CHECK-NEXT: cir.store %[[#SUSPEND]], %[[#SUSPEND_PTR]] : !rec_std3A3Asuspend_always, !cir.ptr // CHECK-NEXT: cir.await(yield, ready : { // CHECK-NEXT: %[[#READY:]] = cir.scope { -// CHECK-NEXT: %[[#A:]] = cir.call @_ZNSt14suspend_always11await_readyEv(%[[#SUSPEND_PTR]]) : (!cir.ptr) -> !cir.bool +// CHECK-NEXT: %[[#A:]] = cir.call @_ZNSt14suspend_always11await_readyEv(%[[#SUSPEND_PTR]]) : (!cir.ptr) -> !cir.bool // CHECK-NEXT: cir.yield %[[#A]] : !cir.bool // CHECK-NEXT: } : !cir.bool // CHECK-NEXT: cir.condition(%[[#READY]]) // CHECK-NEXT: }, suspend : { -// CHECK-NEXT: %[[#CORO2:]] = cir.call @_ZNSt16coroutine_handleIN5folly4coro4TaskIvE12promise_typeEE12from_addressEPv(%9) : (!cir.ptr) -> !ty_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E -// CHECK-NEXT: cir.store %[[#CORO2]], %[[#CORO2_PTR]] : !ty_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E, !cir.ptr -// CHECK-NEXT: %[[#B:]] = cir.load %[[#CORO2_PTR]] : !cir.ptr, !ty_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E -// CHECK-NEXT: cir.call @_ZNSt16coroutine_handleIvEC1IN5folly4coro4TaskIvE12promise_typeEEES_IT_E(%[[#CORO_PTR]], %[[#B]]) : (!cir.ptr, !ty_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E) -> () -// CHECK-NEXT: %[[#C:]] = cir.load %[[#CORO_PTR]] : !cir.ptr, !ty_std3A3Acoroutine_handle3Cvoid3E -// CHECK-NEXT: cir.call @_ZNSt14suspend_always13await_suspendESt16coroutine_handleIvE(%[[#SUSPEND_PTR]], %[[#C]]) : (!cir.ptr, !ty_std3A3Acoroutine_handle3Cvoid3E) -> () +// CHECK-NEXT: %[[#CORO2:]] = cir.call @_ZNSt16coroutine_handleIN5folly4coro4TaskIvE12promise_typeEE12from_addressEPv(%9) : (!cir.ptr) -> !rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E +// CHECK-NEXT: cir.store %[[#CORO2]], %[[#CORO2_PTR]] : !rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E, !cir.ptr +// CHECK-NEXT: %[[#B:]] = cir.load %[[#CORO2_PTR]] : !cir.ptr, !rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E +// CHECK-NEXT: cir.call @_ZNSt16coroutine_handleIvEC1IN5folly4coro4TaskIvE12promise_typeEEES_IT_E(%[[#CORO_PTR]], %[[#B]]) : (!cir.ptr, !rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cvoid3E3A3Apromise_type3E) -> () +// CHECK-NEXT: %[[#C:]] = cir.load %[[#CORO_PTR]] : !cir.ptr, !rec_std3A3Acoroutine_handle3Cvoid3E +// CHECK-NEXT: cir.call @_ZNSt14suspend_always13await_suspendESt16coroutine_handleIvE(%[[#SUSPEND_PTR]], %[[#C]]) : (!cir.ptr, !rec_std3A3Acoroutine_handle3Cvoid3E) -> () // CHECK-NEXT: cir.yield // CHECK-NEXT: }, resume : { -// CHECK-NEXT: cir.call @_ZNSt14suspend_always12await_resumeEv(%[[#SUSPEND_PTR]]) : (!cir.ptr) -> () +// CHECK-NEXT: cir.call @_ZNSt14suspend_always12await_resumeEv(%[[#SUSPEND_PTR]]) : (!cir.ptr) -> () // CHECK-NEXT: cir.yield // CHECK-NEXT: },) // CHECK-NEXT: } diff --git a/clang/test/CIR/CodeGen/ctor-alias.cpp b/clang/test/CIR/CodeGen/ctor-alias.cpp index 8cca664a5b3c..7f584c061c4a 100644 --- a/clang/test/CIR/CodeGen/ctor-alias.cpp +++ b/clang/test/CIR/CodeGen/ctor-alias.cpp @@ -9,20 +9,20 @@ void t() { } // CHECK: cir.func linkonce_odr @_ZN11DummyStringC2EPKc -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NOT: cir.fun @_ZN11DummyStringC1EPKc // CHECK: cir.func @_Z1tv -// CHECK-NEXT: %0 = cir.alloca !ty_DummyString, !cir.ptr, ["s4", init] {alignment = 1 : i64} +// CHECK-NEXT: %0 = cir.alloca !rec_DummyString, !cir.ptr, ["s4", init] {alignment = 1 : i64} // CHECK-NEXT: %1 = cir.get_global @".str" : !cir.ptr> // CHECK-NEXT: %2 = cir.cast(array_to_ptrdecay, %1 : !cir.ptr>), !cir.ptr -// CHECK-NEXT: cir.call @_ZN11DummyStringC2EPKc(%0, %2) : (!cir.ptr, !cir.ptr) -> () +// CHECK-NEXT: cir.call @_ZN11DummyStringC2EPKc(%0, %2) : (!cir.ptr, !cir.ptr) -> () // CHECK-NEXT: cir.return struct B { @@ -31,10 +31,10 @@ struct B { B::B() { } -// CHECK: cir.func @_ZN1BC2Ev(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: cir.func @_ZN1BC2Ev(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK: cir.return // CHECK: } -// CHECK: cir.func private @_ZN1BC1Ev(!cir.ptr) alias(@_ZN1BC2Ev) \ No newline at end of file +// CHECK: cir.func private @_ZN1BC1Ev(!cir.ptr) alias(@_ZN1BC2Ev) diff --git a/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp b/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp index 251ff35bfcff..c90ee5e325a7 100644 --- a/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp +++ b/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp @@ -6,8 +6,8 @@ struct String { long size; String(const String &s) : size{s.size} {} // CHECK: cir.func linkonce_odr @_ZN6StringC2ERKS_ -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] {alignment = 8 : i64} // CHECK: cir.store %arg0, %0 // CHECK: cir.store %arg1, %1 // CHECK: %2 = cir.load %0 @@ -27,9 +27,9 @@ void foo() { String s1{s}; } // CHECK: cir.func @_Z3foov() {{.*}} { -// CHECK: %0 = cir.alloca !ty_String, !cir.ptr, ["s", init] {alignment = 8 : i64} -// CHECK: %1 = cir.alloca !ty_String, !cir.ptr, ["s1", init] {alignment = 8 : i64} -// CHECK: cir.call @_ZN6StringC2Ev(%0) : (!cir.ptr) -> () -// CHECK: cir.call @_ZN6StringC2ERKS_(%1, %0) : (!cir.ptr, !cir.ptr) -> () +// CHECK: %0 = cir.alloca !rec_String, !cir.ptr, ["s", init] {alignment = 8 : i64} +// CHECK: %1 = cir.alloca !rec_String, !cir.ptr, ["s1", init] {alignment = 8 : i64} +// CHECK: cir.call @_ZN6StringC2Ev(%0) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN6StringC2ERKS_(%1, %0) : (!cir.ptr, !cir.ptr) -> () // CHECK: cir.return // } diff --git a/clang/test/CIR/CodeGen/ctor.cpp b/clang/test/CIR/CodeGen/ctor.cpp index c0b524e199ba..8272c286d37f 100644 --- a/clang/test/CIR/CodeGen/ctor.cpp +++ b/clang/test/CIR/CodeGen/ctor.cpp @@ -11,22 +11,22 @@ void baz() { Struk s; } -// CHECK: !ty_Struk = !cir.record +// CHECK: !rec_Struk = !cir.record -// CHECK: cir.func linkonce_odr @_ZN5StrukC2Ev(%arg0: !cir.ptr -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: cir.func linkonce_odr @_ZN5StrukC2Ev(%arg0: !cir.ptr +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.return -// CHECK: cir.func linkonce_odr @_ZN5StrukC1Ev(%arg0: !cir.ptr -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK-NEXT: cir.call @_ZN5StrukC2Ev(%1) : (!cir.ptr) -> () +// CHECK: cir.func linkonce_odr @_ZN5StrukC1Ev(%arg0: !cir.ptr +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: cir.call @_ZN5StrukC2Ev(%1) : (!cir.ptr) -> () // CHECK-NEXT: cir.return // CHECK: cir.func @_Z3bazv() -// CHECK-NEXT: %0 = cir.alloca !ty_Struk, !cir.ptr, ["s", init] {alignment = 4 : i64} -// CHECK-NEXT: cir.call @_ZN5StrukC1Ev(%0) : (!cir.ptr) -> () +// CHECK-NEXT: %0 = cir.alloca !rec_Struk, !cir.ptr, ["s", init] {alignment = 4 : i64} +// CHECK-NEXT: cir.call @_ZN5StrukC1Ev(%0) : (!cir.ptr) -> () // CHECK-NEXT: cir.return diff --git a/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp b/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp index 86e46ee503bb..cdabba148e0a 100644 --- a/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp +++ b/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp @@ -26,33 +26,33 @@ void C::pure() {} // CHECK-SAME: #cir.global_view<@__cxa_pure_virtual> : !cir.ptr]> // The base object destructor should be emitted as normal. -// CHECK-LABEL: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-LABEL: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } // The complete object destructor should trap. -// CHECK-LABEL: cir.func @_ZN1CD1Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-LABEL: cir.func @_ZN1CD1Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.trap // CHECK-NEXT: } // The deleting destructor should trap. -// CHECK-LABEL: cir.func @_ZN1CD0Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-LABEL: cir.func @_ZN1CD0Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.trap // CHECK-NEXT: } // C::pure should be emitted as normal. -// CHECK-LABEL: cir.func @_ZN1C4pureEv(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-LABEL: cir.func @_ZN1C4pureEv(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } diff --git a/clang/test/CIR/CodeGen/delegating-ctor.cpp b/clang/test/CIR/CodeGen/delegating-ctor.cpp index 3c64d76df2cd..0c053bf063d5 100644 --- a/clang/test/CIR/CodeGen/delegating-ctor.cpp +++ b/clang/test/CIR/CodeGen/delegating-ctor.cpp @@ -10,12 +10,12 @@ struct Delegating { // arguments. Delegating::Delegating() : Delegating(0) {} -// CHECK-LABEL: cir.func @_ZN10DelegatingC2Ev(%arg0: !cir.ptr {{.*}}) {{.*}} { -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-LABEL: cir.func @_ZN10DelegatingC2Ev(%arg0: !cir.ptr {{.*}}) {{.*}} { +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: %2 = cir.const #cir.int<0> : !s32i -// CHECK-NEXT: cir.call @_ZN10DelegatingC2Ei(%1, %2) : (!cir.ptr, !s32i) -> () +// CHECK-NEXT: cir.call @_ZN10DelegatingC2Ei(%1, %2) : (!cir.ptr, !s32i) -> () // CHECK-NEXT: cir.return // CHECK-NEXT: } @@ -30,15 +30,15 @@ struct DelegatingWithZeroing { // call to it in a lowering pass. DelegatingWithZeroing::DelegatingWithZeroing(int) : DelegatingWithZeroing() {} -// CHECK-LABEL: cir.func @_ZN21DelegatingWithZeroingC2Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i {{.*}}) {{.*}} { -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-LABEL: cir.func @_ZN21DelegatingWithZeroingC2Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i {{.*}}) {{.*}} { +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["", init] {alignment = 4 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.store %arg1, %1 : !s32i, !cir.ptr -// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK-NEXT: %3 = cir.const #cir.zero : !ty_DelegatingWithZeroing -// CHECK-NEXT: cir.store %3, %2 : !ty_DelegatingWithZeroing, !cir.ptr -// CHECK-NEXT: cir.call @_ZN21DelegatingWithZeroingC2Ev(%2) : (!cir.ptr) -> () extra(#fn_attr{{[0-9]*}}) +// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: %3 = cir.const #cir.zero : !rec_DelegatingWithZeroing +// CHECK-NEXT: cir.store %3, %2 : !rec_DelegatingWithZeroing, !cir.ptr +// CHECK-NEXT: cir.call @_ZN21DelegatingWithZeroingC2Ev(%2) : (!cir.ptr) -> () extra(#fn_attr{{[0-9]*}}) // CHECK-NEXT: cir.return // CHECK-NEXT: } diff --git a/clang/test/CIR/CodeGen/derived-cast.cpp b/clang/test/CIR/CodeGen/derived-cast.cpp index 243f15e8f0c3..6db6a4e4138c 100644 --- a/clang/test/CIR/CodeGen/derived-cast.cpp +++ b/clang/test/CIR/CodeGen/derived-cast.cpp @@ -22,14 +22,14 @@ A *B::getAsA() { } // CIR-LABEL: @_ZN1B6getAsAEv -// CIR: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CIR: %[[VAL_2:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} -// CIR: %[[VAL_3:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr -// CIR: %[[VAL_4:.*]] = cir.derived_class_addr(%[[VAL_3]] : !cir.ptr nonnull) [4] -> !cir.ptr -// CIR: %[[VAL_5:.*]] = cir.base_class_addr(%[[VAL_4]] : !cir.ptr nonnull) [0] -> !cir.ptr -// CIR: cir.store %[[VAL_5]], %[[VAL_2]] : !cir.ptr, !cir.ptr> -// CIR: %[[VAL_6:.*]] = cir.load %[[VAL_2]] : !cir.ptr>, !cir.ptr -// CIR: cir.return %[[VAL_6]] : !cir.ptr +// CIR: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CIR: %[[VAL_2:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} +// CIR: %[[VAL_3:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr +// CIR: %[[VAL_4:.*]] = cir.derived_class_addr(%[[VAL_3]] : !cir.ptr nonnull) [4] -> !cir.ptr +// CIR: %[[VAL_5:.*]] = cir.base_class_addr(%[[VAL_4]] : !cir.ptr nonnull) [0] -> !cir.ptr +// CIR: cir.store %[[VAL_5]], %[[VAL_2]] : !cir.ptr, !cir.ptr> +// CIR: %[[VAL_6:.*]] = cir.load %[[VAL_2]] : !cir.ptr>, !cir.ptr +// CIR: cir.return %[[VAL_6]] : !cir.ptr // LLVM-LABEL: @_ZN1B6getAsAEv // LLVM: %[[VAL_1:.*]] = alloca ptr, i64 1, align 8 @@ -37,4 +37,4 @@ A *B::getAsA() { // LLVM: %[[VAL_3:.*]] = load ptr, ptr %[[VAL_0]], align 8 // LLVM: %[[VAL_4:.*]] = getelementptr i8, ptr %[[VAL_3]], i32 -4 // LLVM-NOT: select i1 -// LLVM: ret ptr \ No newline at end of file +// LLVM: ret ptr diff --git a/clang/test/CIR/CodeGen/derived-to-base.cpp b/clang/test/CIR/CodeGen/derived-to-base.cpp index 14f7a7a57184..76050d3a0086 100644 --- a/clang/test/CIR/CodeGen/derived-to-base.cpp +++ b/clang/test/CIR/CodeGen/derived-to-base.cpp @@ -75,32 +75,32 @@ void C3::Layer::Initialize() { } } -// CHECK-DAG: !ty_C23A3ALayer = !cir.record nonnull) [0] -> !cir.ptr -// CHECK: %3 = cir.get_member %2[1] {name = "m_C1"} : !cir.ptr -> !cir.ptr> -// CHECK: %4 = cir.load %3 : !cir.ptr>, !cir.ptr -// CHECK: %5 = cir.const #cir.ptr : !cir.ptr -// CHECK: %6 = cir.cmp(eq, %4, %5) : !cir.ptr, !cir.bool +// CHECK: %2 = cir.base_class_addr(%1 : !cir.ptr nonnull) [0] -> !cir.ptr +// CHECK: %3 = cir.get_member %2[1] {name = "m_C1"} : !cir.ptr -> !cir.ptr> +// CHECK: %4 = cir.load %3 : !cir.ptr>, !cir.ptr +// CHECK: %5 = cir.const #cir.ptr : !cir.ptr +// CHECK: %6 = cir.cmp(eq, %4, %5) : !cir.ptr, !cir.bool enumy C3::Initialize() { return C2::Initialize(); } -// CHECK: cir.func @_ZN2C310InitializeEv(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.func @_ZN2C310InitializeEv(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: %2 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK: %3 = cir.base_class_addr(%2 : !cir.ptr nonnull) [0] -> !cir.ptr -// CHECK: %4 = cir.call @_ZN2C210InitializeEv(%3) : (!cir.ptr) -> !s32i +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: %3 = cir.base_class_addr(%2 : !cir.ptr nonnull) [0] -> !cir.ptr +// CHECK: %4 = cir.call @_ZN2C210InitializeEv(%3) : (!cir.ptr) -> !s32i void vcall(C1 &c1) { buffy b; @@ -108,21 +108,21 @@ void vcall(C1 &c1) { c1.SetStuff(e, b); } -// CHECK: cir.func @_Z5vcallR2C1(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["c1", init, const] {alignment = 8 : i64} -// CHECK: %1 = cir.alloca !ty_buffy, !cir.ptr, ["b"] {alignment = 8 : i64} +// CHECK: cir.func @_Z5vcallR2C1(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["c1", init, const] {alignment = 8 : i64} +// CHECK: %1 = cir.alloca !rec_buffy, !cir.ptr, ["b"] {alignment = 8 : i64} // CHECK: %2 = cir.alloca !s32i, !cir.ptr, ["e"] {alignment = 4 : i64} -// CHECK: %3 = cir.alloca !ty_buffy, !cir.ptr, ["agg.tmp0"] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: %4 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: %3 = cir.alloca !rec_buffy, !cir.ptr, ["agg.tmp0"] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: %4 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK: %5 = cir.load %2 : !cir.ptr, !s32i -// CHECK: cir.call @_ZN5buffyC2ERKS_(%3, %1) : (!cir.ptr, !cir.ptr) -> () -// CHECK: %6 = cir.load %3 : !cir.ptr, !ty_buffy -// CHECK: %7 = cir.cast(bitcast, %4 : !cir.ptr), !cir.ptr, !s32i, !ty_buffy) -> !s32i>>>> -// CHECK: %8 = cir.load %7 : !cir.ptr, !s32i, !ty_buffy) -> !s32i>>>>, !cir.ptr, !s32i, !ty_buffy) -> !s32i>>> -// CHECK: %9 = cir.vtable.address_point( %8 : !cir.ptr, !s32i, !ty_buffy) -> !s32i>>>, address_point = ) : !cir.ptr, !s32i, !ty_buffy) -> !s32i>>> -// CHECK: %10 = cir.load align(8) %9 : !cir.ptr, !s32i, !ty_buffy) -> !s32i>>>, !cir.ptr, !s32i, !ty_buffy) -> !s32i>> -// CHECK: %11 = cir.call %10(%4, %5, %6) : (!cir.ptr, !s32i, !ty_buffy) -> !s32i>>, !cir.ptr, !s32i, !ty_buffy) -> !s32i +// CHECK: cir.call @_ZN5buffyC2ERKS_(%3, %1) : (!cir.ptr, !cir.ptr) -> () +// CHECK: %6 = cir.load %3 : !cir.ptr, !rec_buffy +// CHECK: %7 = cir.cast(bitcast, %4 : !cir.ptr), !cir.ptr, !s32i, !rec_buffy) -> !s32i>>>> +// CHECK: %8 = cir.load %7 : !cir.ptr, !s32i, !rec_buffy) -> !s32i>>>>, !cir.ptr, !s32i, !rec_buffy) -> !s32i>>> +// CHECK: %9 = cir.vtable.address_point( %8 : !cir.ptr, !s32i, !rec_buffy) -> !s32i>>>, address_point = ) : !cir.ptr, !s32i, !rec_buffy) -> !s32i>>> +// CHECK: %10 = cir.load align(8) %9 : !cir.ptr, !s32i, !rec_buffy) -> !s32i>>>, !cir.ptr, !s32i, !rec_buffy) -> !s32i>> +// CHECK: %11 = cir.call %10(%4, %5, %6) : (!cir.ptr, !s32i, !rec_buffy) -> !s32i>>, !cir.ptr, !s32i, !rec_buffy) -> !s32i // CHECK: cir.return // CHECK: } @@ -138,19 +138,19 @@ class B : public A { void foo () { static_cast(*this).foo();} }; -// CHECK: cir.func linkonce_odr @_ZN1B3fooEv(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: %1 = cir.load deref %0 : !cir.ptr>, !cir.ptr +// CHECK: cir.func linkonce_odr @_ZN1B3fooEv(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: %1 = cir.load deref %0 : !cir.ptr>, !cir.ptr // CHECK: cir.scope { -// CHECK: %2 = cir.alloca !ty_A, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} -// CHECK: %3 = cir.base_class_addr(%1 : !cir.ptr nonnull) [0] -> !cir.ptr +// CHECK: %2 = cir.alloca !rec_A, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} +// CHECK: %3 = cir.base_class_addr(%1 : !cir.ptr nonnull) [0] -> !cir.ptr // Call @A::A(A const&) -// CHECK: cir.call @_ZN1AC2ERKS_(%2, %3) : (!cir.ptr, !cir.ptr) -> () +// CHECK: cir.call @_ZN1AC2ERKS_(%2, %3) : (!cir.ptr, !cir.ptr) -> () // Call @A::foo() -// CHECK: cir.call @_ZN1A3fooEv(%2) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1A3fooEv(%2) : (!cir.ptr) -> () // CHECK: } // CHECK: cir.return // CHECK: } @@ -181,19 +181,19 @@ void test_multi_base() { Derived d; Base2& bref = d; // no null check needed - // CHECK: %6 = cir.base_class_addr(%0 : !cir.ptr nonnull) [4] -> !cir.ptr + // CHECK: %6 = cir.base_class_addr(%0 : !cir.ptr nonnull) [4] -> !cir.ptr Base2* bptr = &d; // has null pointer check - // CHECK: %7 = cir.base_class_addr(%0 : !cir.ptr) [4] -> !cir.ptr + // CHECK: %7 = cir.base_class_addr(%0 : !cir.ptr) [4] -> !cir.ptr int a = d.a; - // CHECK: %8 = cir.base_class_addr(%0 : !cir.ptr nonnull) [0] -> !cir.ptr - // CHECK: %9 = cir.get_member %8[0] {name = "a"} : !cir.ptr -> !cir.ptr + // CHECK: %8 = cir.base_class_addr(%0 : !cir.ptr nonnull) [0] -> !cir.ptr + // CHECK: %9 = cir.get_member %8[0] {name = "a"} : !cir.ptr -> !cir.ptr int b = d.b; - // CHECK: %11 = cir.base_class_addr(%0 : !cir.ptr nonnull) [4] -> !cir.ptr - // CHECK: %12 = cir.get_member %11[0] {name = "b"} : !cir.ptr -> !cir.ptr + // CHECK: %11 = cir.base_class_addr(%0 : !cir.ptr nonnull) [4] -> !cir.ptr + // CHECK: %12 = cir.get_member %11[0] {name = "b"} : !cir.ptr -> !cir.ptr int c = d.c; - // CHECK: %14 = cir.get_member %0[2] {name = "c"} : !cir.ptr -> !cir.ptr + // CHECK: %14 = cir.get_member %0[2] {name = "c"} : !cir.ptr -> !cir.ptr } diff --git a/clang/test/CIR/CodeGen/dtor-alias.cpp b/clang/test/CIR/CodeGen/dtor-alias.cpp index f6e34d560688..302a3c02b624 100644 --- a/clang/test/CIR/CodeGen/dtor-alias.cpp +++ b/clang/test/CIR/CodeGen/dtor-alias.cpp @@ -13,4 +13,4 @@ struct B : public A {}; B x; -// CHECK: cir.call @_ZN12_GLOBAL__N_11AD2Ev({{.*}}) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN12_GLOBAL__N_11AD2Ev({{.*}}) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/dtors-scopes.cpp b/clang/test/CIR/CodeGen/dtors-scopes.cpp index baa1d7666df9..3af3338ffc72 100644 --- a/clang/test/CIR/CodeGen/dtors-scopes.cpp +++ b/clang/test/CIR/CodeGen/dtors-scopes.cpp @@ -17,9 +17,9 @@ void dtor1() { // CHECK: cir.func @_Z5dtor1v() // CHECK: cir.scope { -// CHECK: %4 = cir.alloca !ty_C, !cir.ptr, ["c", init] {alignment = 1 : i64} -// CHECK: cir.call @_ZN1CC2Ev(%4) : (!cir.ptr) -> () -// CHECK: cir.call @_ZN1CD2Ev(%4) : (!cir.ptr) -> () +// CHECK: %4 = cir.alloca !rec_C, !cir.ptr, ["c", init] {alignment = 1 : i64} +// CHECK: cir.call @_ZN1CC2Ev(%4) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1CD2Ev(%4) : (!cir.ptr) -> () // CHECK: } // DTOR_BODY: cir.func linkonce_odr @_ZN1CD2Ev{{.*}}{ @@ -29,7 +29,7 @@ void dtor1() { // DTOR_BODY: %5 = cir.call @printf(%4) // DTOR_BODY: cir.return -// DTOR_BODY: cir.func linkonce_odr @_ZN1CD1Ev(%arg0: !cir.ptr +// DTOR_BODY: cir.func linkonce_odr @_ZN1CD1Ev(%arg0: !cir.ptr // DTOR_BODY: cir.call @_ZN1CD2Ev // DTOR_BODY: cir.return diff --git a/clang/test/CIR/CodeGen/dtors.cpp b/clang/test/CIR/CodeGen/dtors.cpp index 7a524d45dc16..38bf860b6e48 100644 --- a/clang/test/CIR/CodeGen/dtors.cpp +++ b/clang/test/CIR/CodeGen/dtors.cpp @@ -36,17 +36,17 @@ class B : public A }; // Class A -// CHECK: ![[ClassA:ty_.*]] = !cir.record !u32i>>>} #cir.record.decl.ast> +// CHECK: ![[ClassA:rec_.*]] = !cir.record !u32i>>>} #cir.record.decl.ast> // Class B -// CHECK: ![[ClassB:ty_.*]] = !cir.record +// CHECK: ![[ClassB:rec_.*]] = !cir.record // CHECK: cir.func @_Z4bluev() -// CHECK: %0 = cir.alloca !ty_PSEvent, !cir.ptr, ["p", init] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !rec_PSEvent, !cir.ptr, ["p", init] {alignment = 8 : i64} // CHECK: %1 = cir.const #cir.int<1> : !s32i // CHECK: %2 = cir.get_global @".str" : !cir.ptr> // CHECK: %3 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr -// CHECK: cir.call @_ZN7PSEventC1E6EFModePKc(%0, %1, %3) : (!cir.ptr, !s32i, !cir.ptr) -> () +// CHECK: cir.call @_ZN7PSEventC1E6EFModePKc(%0, %1, %3) : (!cir.ptr, !s32i, !cir.ptr) -> () // CHECK: cir.return // CHECK: } @@ -57,8 +57,8 @@ class B : public A // void foo() // CHECK: cir.func @_Z3foov() // CHECK: cir.scope { -// CHECK: cir.call @_ZN1BC2Ev(%0) : (!cir.ptr) -> () -// CHECK: cir.call @_ZN1BD2Ev(%0) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1BC2Ev(%0) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1BD2Ev(%0) : (!cir.ptr) -> () // operator delete(void*) declaration // CHECK: cir.func private @_ZdlPvm(!cir.ptr, !u64i) diff --git a/clang/test/CIR/CodeGen/dynamic-cast-exact.cpp b/clang/test/CIR/CodeGen/dynamic-cast-exact.cpp index c45baefaa107..a53f2ebe714f 100644 --- a/clang/test/CIR/CodeGen/dynamic-cast-exact.cpp +++ b/clang/test/CIR/CodeGen/dynamic-cast-exact.cpp @@ -15,18 +15,18 @@ struct Derived final : Base1 {}; Derived *ptr_cast(Base1 *ptr) { return dynamic_cast(ptr); - // CHECK: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr + // CHECK: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr // CHECK-NEXT: %[[#EXPECTED_VPTR:]] = cir.vtable.address_point(@_ZTV7Derived, address_point = ) : !cir.ptr !u32i>>> - // CHECK-NEXT: %[[#SRC_VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr !u32i>>>> + // CHECK-NEXT: %[[#SRC_VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr !u32i>>>> // CHECK-NEXT: %[[#SRC_VPTR:]] = cir.load %[[#SRC_VPTR_PTR]] : !cir.ptr !u32i>>>>, !cir.ptr !u32i>>> // CHECK-NEXT: %[[#SUCCESS:]] = cir.cmp(eq, %[[#SRC_VPTR]], %[[#EXPECTED_VPTR]]) : !cir.ptr !u32i>>>, !cir.bool // CHECK-NEXT: %{{.+}} = cir.ternary(%[[#SUCCESS]], true { - // CHECK-NEXT: %[[#RES:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr - // CHECK-NEXT: cir.yield %[[#RES]] : !cir.ptr + // CHECK-NEXT: %[[#RES:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr + // CHECK-NEXT: cir.yield %[[#RES]] : !cir.ptr // CHECK-NEXT: }, false { - // CHECK-NEXT: %[[#NULL:]] = cir.const #cir.ptr : !cir.ptr - // CHECK-NEXT: cir.yield %[[#NULL]] : !cir.ptr - // CHECK-NEXT: }) : (!cir.bool) -> !cir.ptr + // CHECK-NEXT: %[[#NULL:]] = cir.const #cir.ptr : !cir.ptr + // CHECK-NEXT: cir.yield %[[#NULL]] : !cir.ptr + // CHECK-NEXT: }) : (!cir.bool) -> !cir.ptr } // LLVM: define dso_local ptr @_Z8ptr_castP5Base1(ptr readonly captures(ret: address, provenance) %[[#SRC:]]) @@ -38,9 +38,9 @@ Derived *ptr_cast(Base1 *ptr) { Derived &ref_cast(Base1 &ref) { return dynamic_cast(ref); - // CHECK: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr + // CHECK: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr // CHECK-NEXT: %[[#EXPECTED_VPTR:]] = cir.vtable.address_point(@_ZTV7Derived, address_point = ) : !cir.ptr !u32i>>> - // CHECK-NEXT: %[[#SRC_VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr !u32i>>>> + // CHECK-NEXT: %[[#SRC_VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr !u32i>>>> // CHECK-NEXT: %[[#SRC_VPTR:]] = cir.load %[[#SRC_VPTR_PTR]] : !cir.ptr !u32i>>>>, !cir.ptr !u32i>>> // CHECK-NEXT: %[[#SUCCESS:]] = cir.cmp(eq, %[[#SRC_VPTR]], %[[#EXPECTED_VPTR]]) : !cir.ptr !u32i>>>, !cir.bool // CHECK-NEXT: %[[#FAILED:]] = cir.unary(not, %[[#SUCCESS]]) : !cir.bool, !cir.bool @@ -48,7 +48,7 @@ Derived &ref_cast(Base1 &ref) { // CHECK-NEXT: cir.call @__cxa_bad_cast() : () -> () // CHECK-NEXT: cir.unreachable // CHECK-NEXT: } - // CHECK-NEXT: %{{.+}} = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr + // CHECK-NEXT: %{{.+}} = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr } // LLVM: define dso_local noundef ptr @_Z8ref_castR5Base1(ptr readonly returned captures(ret: address, provenance) %[[#SRC:]]) @@ -64,9 +64,9 @@ Derived &ref_cast(Base1 &ref) { Derived *ptr_cast_always_fail(Base2 *ptr) { return dynamic_cast(ptr); - // CHECK: %{{.+}} = cir.load %{{.+}} : !cir.ptr>, !cir.ptr - // CHECK-NEXT: %[[#RESULT:]] = cir.const #cir.ptr : !cir.ptr - // CHECK-NEXT: cir.store %[[#RESULT]], %{{.+}} : !cir.ptr, !cir.ptr> + // CHECK: %{{.+}} = cir.load %{{.+}} : !cir.ptr>, !cir.ptr + // CHECK-NEXT: %[[#RESULT:]] = cir.const #cir.ptr : !cir.ptr + // CHECK-NEXT: cir.store %[[#RESULT]], %{{.+}} : !cir.ptr, !cir.ptr> } // LLVM: define dso_local noalias noundef ptr @_Z20ptr_cast_always_failP5Base2(ptr readnone captures(none) %{{.+}}) @@ -75,8 +75,8 @@ Derived *ptr_cast_always_fail(Base2 *ptr) { Derived &ref_cast_always_fail(Base2 &ref) { return dynamic_cast(ref); - // CHECK: %{{.+}} = cir.load %{{.+}} : !cir.ptr>, !cir.ptr - // CHECK-NEXT: %{{.+}} = cir.const #cir.ptr : !cir.ptr + // CHECK: %{{.+}} = cir.load %{{.+}} : !cir.ptr>, !cir.ptr + // CHECK-NEXT: %{{.+}} = cir.const #cir.ptr : !cir.ptr // CHECK-NEXT: cir.call @__cxa_bad_cast() : () -> () // CHECK-NEXT: cir.unreachable } diff --git a/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp b/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp index 33c5adc295da..8b2c18876ef0 100644 --- a/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp +++ b/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp @@ -5,25 +5,25 @@ struct Base { virtual ~Base(); }; -// BEFORE: !ty_Base = !cir.record(ptr); } // BEFORE: cir.func @_Z20ptr_cast_to_completeP4Base -// BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr relative_layout) -> !cir.ptr +// BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr relative_layout) -> !cir.ptr // BEFORE: } // AFTER: cir.func @_Z20ptr_cast_to_completeP4Base -// AFTER: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr -// AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool +// AFTER: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr +// AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool // AFTER-NEXT: %{{.+}} = cir.ternary(%[[#SRC_IS_NOT_NULL]], true { -// AFTER-NEXT: %[[#VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr> +// AFTER-NEXT: %[[#VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr> // AFTER-NEXT: %[[#VPTR:]] = cir.load %[[#VPTR_PTR]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: %[[#OFFSET_TO_TOP_PTR:]] = cir.vtable.address_point( %[[#VPTR]] : !cir.ptr, address_point = ) : !cir.ptr // AFTER-NEXT: %[[#OFFSET_TO_TOP:]] = cir.load align(4) %[[#OFFSET_TO_TOP_PTR]] : !cir.ptr, !s32i -// AFTER-NEXT: %[[#SRC_BYTES_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr +// AFTER-NEXT: %[[#SRC_BYTES_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr // AFTER-NEXT: %[[#DST_BYTES_PTR:]] = cir.ptr_stride(%[[#SRC_BYTES_PTR]] : !cir.ptr, %[[#OFFSET_TO_TOP]] : !s32i), !cir.ptr // AFTER-NEXT: %[[#DST:]] = cir.cast(bitcast, %[[#DST_BYTES_PTR]] : !cir.ptr), !cir.ptr // AFTER-NEXT: cir.yield %[[#DST]] : !cir.ptr diff --git a/clang/test/CIR/CodeGen/dynamic-cast.cpp b/clang/test/CIR/CodeGen/dynamic-cast.cpp index e0bc4388653c..d010636a622f 100644 --- a/clang/test/CIR/CodeGen/dynamic-cast.cpp +++ b/clang/test/CIR/CodeGen/dynamic-cast.cpp @@ -8,32 +8,32 @@ struct Base { struct Derived : Base {}; // BEFORE: #dyn_cast_info__ZTI4Base__ZTI7Derived = #cir.dyn_cast_info<#cir.global_view<@_ZTI4Base> : !cir.ptr, #cir.global_view<@_ZTI7Derived> : !cir.ptr, @__dynamic_cast, @__cxa_bad_cast, #cir.int<0> : !s64i> -// BEFORE: !ty_Base = !cir.record -// BEFORE: !ty_Derived = !cir.record +// BEFORE: !rec_Base = !cir.record +// BEFORE: !rec_Derived = !cir.record Derived *ptr_cast(Base *b) { return dynamic_cast(b); } // BEFORE: cir.func @_Z8ptr_castP4Base -// BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr, #dyn_cast_info__ZTI4Base__ZTI7Derived) -> !cir.ptr +// BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr, #dyn_cast_info__ZTI4Base__ZTI7Derived) -> !cir.ptr // BEFORE: } // AFTER: cir.func @_Z8ptr_castP4Base -// AFTER: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr -// AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool +// AFTER: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr +// AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool // AFTER-NEXT: %{{.+}} = cir.ternary(%[[#SRC_IS_NOT_NULL]], true { -// AFTER-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr +// AFTER-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr // AFTER-NEXT: %[[#BASE_RTTI:]] = cir.const #cir.global_view<@_ZTI4Base> : !cir.ptr // AFTER-NEXT: %[[#DERIVED_RTTI:]] = cir.const #cir.global_view<@_ZTI7Derived> : !cir.ptr // AFTER-NEXT: %[[#HINT:]] = cir.const #cir.int<0> : !s64i // AFTER-NEXT: %[[#RT_CALL_RET:]] = cir.call @__dynamic_cast(%[[#SRC_VOID_PTR]], %[[#BASE_RTTI]], %[[#DERIVED_RTTI]], %[[#HINT]]) : (!cir.ptr, !cir.ptr, !cir.ptr, !s64i) -> !cir.ptr -// AFTER-NEXT: %[[#CASTED:]] = cir.cast(bitcast, %[[#RT_CALL_RET]] : !cir.ptr), !cir.ptr -// AFTER-NEXT: cir.yield %[[#CASTED]] : !cir.ptr +// AFTER-NEXT: %[[#CASTED:]] = cir.cast(bitcast, %[[#RT_CALL_RET]] : !cir.ptr), !cir.ptr +// AFTER-NEXT: cir.yield %[[#CASTED]] : !cir.ptr // AFTER-NEXT: }, false { -// AFTER-NEXT: %[[#NULL_PTR:]] = cir.const #cir.ptr : !cir.ptr -// AFTER-NEXT: cir.yield %[[#NULL_PTR]] : !cir.ptr -// AFTER-NEXT: }) : (!cir.bool) -> !cir.ptr +// AFTER-NEXT: %[[#NULL_PTR:]] = cir.const #cir.ptr : !cir.ptr +// AFTER-NEXT: cir.yield %[[#NULL_PTR]] : !cir.ptr +// AFTER-NEXT: }) : (!cir.bool) -> !cir.ptr // AFTER: } Derived &ref_cast(Base &b) { @@ -41,11 +41,11 @@ Derived &ref_cast(Base &b) { } // BEFORE: cir.func @_Z8ref_castR4Base -// BEFORE: %{{.+}} = cir.dyn_cast(ref, %{{.+}} : !cir.ptr, #dyn_cast_info__ZTI4Base__ZTI7Derived) -> !cir.ptr +// BEFORE: %{{.+}} = cir.dyn_cast(ref, %{{.+}} : !cir.ptr, #dyn_cast_info__ZTI4Base__ZTI7Derived) -> !cir.ptr // BEFORE: } // AFTER: cir.func @_Z8ref_castR4Base -// AFTER: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr +// AFTER: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // AFTER-NEXT: %[[#SRC_RTTI:]] = cir.const #cir.global_view<@_ZTI4Base> : !cir.ptr // AFTER-NEXT: %[[#DEST_RTTI:]] = cir.const #cir.global_view<@_ZTI7Derived> : !cir.ptr // AFTER-NEXT: %[[#OFFSET_HINT:]] = cir.const #cir.int<0> : !s64i @@ -56,7 +56,7 @@ Derived &ref_cast(Base &b) { // AFTER-NEXT: cir.call @__cxa_bad_cast() : () -> () // AFTER-NEXT: cir.unreachable // AFTER-NEXT: } -// AFTER-NEXT: %{{.+}} = cir.cast(bitcast, %[[#CASTED_PTR]] : !cir.ptr), !cir.ptr +// AFTER-NEXT: %{{.+}} = cir.cast(bitcast, %[[#CASTED_PTR]] : !cir.ptr), !cir.ptr // AFTER: } void *ptr_cast_to_complete(Base *ptr) { @@ -64,18 +64,18 @@ void *ptr_cast_to_complete(Base *ptr) { } // BEFORE: cir.func @_Z20ptr_cast_to_completeP4Base -// BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr) -> !cir.ptr +// BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr) -> !cir.ptr // BEFORE: } // AFTER: cir.func @_Z20ptr_cast_to_completeP4Base -// AFTER: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr -// AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool +// AFTER: %[[#SRC:]] = cir.load %{{.+}} : !cir.ptr>, !cir.ptr +// AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool // AFTER-NEXT: %{{.+}} = cir.ternary(%[[#SRC_IS_NOT_NULL]], true { -// AFTER-NEXT: %[[#VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr> +// AFTER-NEXT: %[[#VPTR_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr> // AFTER-NEXT: %[[#VPTR:]] = cir.load %[[#VPTR_PTR]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: %[[#BASE_OFFSET_PTR:]] = cir.vtable.address_point( %[[#VPTR]] : !cir.ptr, address_point = ) : !cir.ptr // AFTER-NEXT: %[[#BASE_OFFSET:]] = cir.load align(8) %[[#BASE_OFFSET_PTR]] : !cir.ptr, !s64i -// AFTER-NEXT: %[[#SRC_BYTES_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr +// AFTER-NEXT: %[[#SRC_BYTES_PTR:]] = cir.cast(bitcast, %[[#SRC]] : !cir.ptr), !cir.ptr // AFTER-NEXT: %[[#DST_BYTES_PTR:]] = cir.ptr_stride(%[[#SRC_BYTES_PTR]] : !cir.ptr, %[[#BASE_OFFSET]] : !s64i), !cir.ptr // AFTER-NEXT: %[[#CASTED_PTR:]] = cir.cast(bitcast, %[[#DST_BYTES_PTR]] : !cir.ptr), !cir.ptr // AFTER-NEXT: cir.yield %[[#CASTED_PTR]] : !cir.ptr diff --git a/clang/test/CIR/CodeGen/eh.cpp b/clang/test/CIR/CodeGen/eh.cpp index 96a8633a3252..280236d89bdc 100644 --- a/clang/test/CIR/CodeGen/eh.cpp +++ b/clang/test/CIR/CodeGen/eh.cpp @@ -12,10 +12,10 @@ void test1() { } // CIR-LABEL: @_Z5test1v -// CIR: %[[ALLOC:.*]] = cir.alloc.exception 8 -> !cir.ptr -// CIR: %[[G:.*]] = cir.get_global @d1 : !cir.ptr -// CIR: cir.call @_ZN7test1_DC1ERKS_(%[[ALLOC]], %[[G]]) : (!cir.ptr, !cir.ptr) -> () -// CIR: cir.throw %[[ALLOC]] : !cir.ptr, @_ZTI7test1_D +// CIR: %[[ALLOC:.*]] = cir.alloc.exception 8 -> !cir.ptr +// CIR: %[[G:.*]] = cir.get_global @d1 : !cir.ptr +// CIR: cir.call @_ZN7test1_DC1ERKS_(%[[ALLOC]], %[[G]]) : (!cir.ptr, !cir.ptr) -> () +// CIR: cir.throw %[[ALLOC]] : !cir.ptr, @_ZTI7test1_D // CIR: cir.unreachable // CIR: } @@ -40,11 +40,11 @@ void test2() { } // CIR-LABEL: @_Z5test2v -// CIR: %[[ALLOC:.*]] = cir.alloc.exception 16 -> !cir.ptr -// CIR: %[[G:.*]] = cir.get_global @d2 : !cir.ptr +// CIR: %[[ALLOC:.*]] = cir.alloc.exception 16 -> !cir.ptr +// CIR: %[[G:.*]] = cir.get_global @d2 : !cir.ptr // CIR: cir.try synthetic cleanup { -// CIR: cir.call exception @_ZN7test2_DC1ERKS_(%[[ALLOC]], %[[G]]) : (!cir.ptr, !cir.ptr) -> () cleanup { -// CIR: %[[VOID_PTR:.*]] = cir.cast(bitcast, %[[ALLOC]] : !cir.ptr), !cir.ptr +// CIR: cir.call exception @_ZN7test2_DC1ERKS_(%[[ALLOC]], %[[G]]) : (!cir.ptr, !cir.ptr) -> () cleanup { +// CIR: %[[VOID_PTR:.*]] = cir.cast(bitcast, %[[ALLOC]] : !cir.ptr), !cir.ptr // CIR: cir.free.exception %[[VOID_PTR]] // CIR: cir.yield // CIR: } @@ -52,7 +52,7 @@ void test2() { // CIR: } catch [#cir.unwind { // CIR: cir.resume // CIR: }] -// CIR: cir.throw %[[ALLOC]] : !cir.ptr, @_ZTI7test2_D +// CIR: cir.throw %[[ALLOC]] : !cir.ptr, @_ZTI7test2_D // CIR: cir.unreachable // LLVM-LABEL: @_Z5test2v @@ -63,4 +63,4 @@ void test2() { // LLVM: cleanup // LLVM: extractvalue { ptr, i32 } // LLVM: extractvalue { ptr, i32 } -// LLVM: call void @__cxa_free_exception(ptr %[[ALLOC]]) \ No newline at end of file +// LLVM: call void @__cxa_free_exception(ptr %[[ALLOC]]) diff --git a/clang/test/CIR/CodeGen/evaluate-expr.c b/clang/test/CIR/CodeGen/evaluate-expr.c index 4b7146622dbf..b584eb14517a 100644 --- a/clang/test/CIR/CodeGen/evaluate-expr.c +++ b/clang/test/CIR/CodeGen/evaluate-expr.c @@ -25,7 +25,7 @@ void bar() { } // CHECK: cir.func no_proto @bar() // CHECK: [[ALLOC:%.*]] = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} -// CHECK: {{%.*}} = cir.get_global @s : !cir.ptr +// CHECK: {{%.*}} = cir.get_global @s : !cir.ptr // CHECK: [[CONST:%.*]] = cir.const #cir.int<0> : !s32i // CHECK: cir.store [[CONST]], [[ALLOC]] : !s32i, !cir.ptr // CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/forward-decls.cpp b/clang/test/CIR/CodeGen/forward-decls.cpp index fdaa79a55073..34eecb8d1ab8 100644 --- a/clang/test/CIR/CodeGen/forward-decls.cpp +++ b/clang/test/CIR/CodeGen/forward-decls.cpp @@ -97,11 +97,11 @@ void testIndirectSelfReference(struct StructNodeA arg) { // A sizeable complex struct just to double check that stuff is working. // CHECK5: !cir.record, !cir.record>, !cir.record>, !cir.ptr>, !cir.ptr>} #cir.record.decl.ast>, !cir.record>, !cir.record>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>>} #cir.record.decl.ast> -// CHECK5: !cir.record>, !cir.record, !cir.record>, !cir.record>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>>, !cir.ptr>, !cir.record, !cir.record} #cir.record.decl.ast>>, !cir.record>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>>, !cir.ptr>} #cir.record.decl.ast> -// CHECK5: !cir.record>, !ty_C, !cir.record} #cir.record.decl.ast>>, !cir.record} #cir.record.decl.ast>} #cir.record.decl.ast>>} #cir.record.decl.ast> -// CHECK5: !cir.record>, !ty_C, !cir.record} #cir.record.decl.ast>} #cir.record.decl.ast>>, !ty_anon2E2} #cir.record.decl.ast> -// CHECK5: !cir.record>, !ty_C, !ty_anon2E1} #cir.record.decl.ast> -// CHECK5: !cir.record +// CHECK5: !cir.record>, !cir.record, !cir.record>, !cir.record>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>>, !cir.ptr>, !cir.record, !cir.record} #cir.record.decl.ast>>, !cir.record>} #cir.record.decl.ast>} #cir.record.decl.ast>} #cir.record.decl.ast>>, !cir.ptr>} #cir.record.decl.ast> +// CHECK5: !cir.record>, !rec_C, !cir.record} #cir.record.decl.ast>>, !cir.record} #cir.record.decl.ast>} #cir.record.decl.ast>>} #cir.record.decl.ast> +// CHECK5: !cir.record>, !rec_C, !cir.record} #cir.record.decl.ast>} #cir.record.decl.ast>>, !rec_anon2E2} #cir.record.decl.ast> +// CHECK5: !cir.record>, !rec_C, !rec_anon2E1} #cir.record.decl.ast> +// CHECK5: !cir.record struct A { struct { struct A *a1; diff --git a/clang/test/CIR/CodeGen/fun-ptr.c b/clang/test/CIR/CodeGen/fun-ptr.c index 329e653a5f8d..b769206a631e 100644 --- a/clang/test/CIR/CodeGen/fun-ptr.c +++ b/clang/test/CIR/CodeGen/fun-ptr.c @@ -17,25 +17,25 @@ typedef struct A { fun_typ fun; } A; -// CIR: !ty_A = !cir.record>) -> !s32i>>} #cir.record.decl.ast> +// CIR: !rec_A = !cir.record>) -> !s32i>>} #cir.record.decl.ast> A a = {(fun_typ)0}; int extract_a(Data* d) { return d->a; } -// CIR: cir.func {{@.*foo.*}}(%arg0: !cir.ptr -// CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] +// CIR: cir.func {{@.*foo.*}}(%arg0: !cir.ptr +// CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] // CIR: [[TMP1:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] -// CIR: [[TMP2:%.*]] = cir.alloca !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>>, ["f", init] -// CIR: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> -// CIR: [[TMP3:%.*]] = cir.const #cir.ptr : !cir.ptr) -> !s32i>> -// CIR: cir.store [[TMP3]], [[TMP2]] : !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>> -// CIR: [[TMP4:%.*]] = cir.get_global {{@.*extract_a.*}} : !cir.ptr) -> !s32i>> -// CIR: cir.store [[TMP4]], [[TMP2]] : !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>> -// CIR: [[TMP5:%.*]] = cir.load [[TMP2]] : !cir.ptr) -> !s32i>>>, !cir.ptr) -> !s32i>> -// CIR: [[TMP6:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr -// CIR: [[TMP7:%.*]] = cir.call [[TMP5]]([[TMP6]]) : (!cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i +// CIR: [[TMP2:%.*]] = cir.alloca !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>>, ["f", init] +// CIR: cir.store %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> +// CIR: [[TMP3:%.*]] = cir.const #cir.ptr : !cir.ptr) -> !s32i>> +// CIR: cir.store [[TMP3]], [[TMP2]] : !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>> +// CIR: [[TMP4:%.*]] = cir.get_global {{@.*extract_a.*}} : !cir.ptr) -> !s32i>> +// CIR: cir.store [[TMP4]], [[TMP2]] : !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>> +// CIR: [[TMP5:%.*]] = cir.load [[TMP2]] : !cir.ptr) -> !s32i>>>, !cir.ptr) -> !s32i>> +// CIR: [[TMP6:%.*]] = cir.load [[TMP0]] : !cir.ptr>, !cir.ptr +// CIR: [[TMP7:%.*]] = cir.call [[TMP5]]([[TMP6]]) : (!cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i // CIR: cir.store [[TMP7]], [[TMP1]] : !s32i, !cir.ptr // LLVM: define dso_local i32 {{@.*foo.*}}(ptr %0) diff --git a/clang/test/CIR/CodeGen/globals-neg-index-array.c b/clang/test/CIR/CodeGen/globals-neg-index-array.c index a008415c2a8f..4643edba8940 100644 --- a/clang/test/CIR/CodeGen/globals-neg-index-array.c +++ b/clang/test/CIR/CodeGen/globals-neg-index-array.c @@ -15,7 +15,7 @@ struct __attribute__((packed)) PackedStruct { }; struct PackedStruct packed[10]; char *packed_element = &(packed[-2].a3); -// CHECK: cir.global external @packed = #cir.zero : !cir.array {alignment = 16 : i64} loc(#loc5) +// CHECK: cir.global external @packed = #cir.zero : !cir.array {alignment = 16 : i64} loc(#loc5) // CHECK: cir.global external @packed_element = #cir.global_view<@packed, [-2 : i32, 2 : i32]> // LLVM: @packed = global [10 x %struct.PackedStruct] zeroinitializer // LLVM: @packed_element = global ptr getelementptr inbounds ([10 x %struct.PackedStruct], ptr @packed, i32 0, i32 -2, i32 2) diff --git a/clang/test/CIR/CodeGen/globals-ref-globals.c b/clang/test/CIR/CodeGen/globals-ref-globals.c index 90cd2562da2b..7902c3ce70e8 100644 --- a/clang/test/CIR/CodeGen/globals-ref-globals.c +++ b/clang/test/CIR/CodeGen/globals-ref-globals.c @@ -20,17 +20,17 @@ static S g6[2] = {{2799, 9, 123}, {2799, 9, 123}}; static int *g7[2] = {&g6[0].f2, &g6[1].f2}; static int **g8 = &g7[1]; -// CHECK-DAG: !ty_anon_struct = !cir.record -// CHECK-DAG: !ty_anon_struct1 = !cir.record, !s32i}> -// CHECK-DAG: !ty_anon_struct2 = !cir.record -// CHECK-DAG: !ty_anon_struct3 = !cir.record, !s32i, !s8i, !cir.array}> +// CHECK-DAG: !rec_anon_struct = !cir.record +// CHECK-DAG: !rec_anon_struct1 = !cir.record, !s32i}> +// CHECK-DAG: !rec_anon_struct2 = !cir.record +// CHECK-DAG: !rec_anon_struct3 = !cir.record, !s32i, !s8i, !cir.array}> -// CHECK-DAG: g1 = #cir.const_record<{#cir.int<239> : !u8i, #cir.int<10> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<9> : !s32i, #cir.int<123> : !s32i}> : !ty_anon_struct -// CHECK-DAG: g2 = #cir.const_array<[#cir.global_view<@g1, [4]> : !cir.ptr, #cir.global_view<@g1, [4]> : !cir.ptr, #cir.global_view<@g1, [4]> : !cir.ptr, #cir.global_view<@g1, [4]> : !cir.ptr]> : !cir.array x 4> +// CHECK-DAG: g1 = #cir.const_record<{#cir.int<239> : !u8i, #cir.int<10> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<9> : !s32i, #cir.int<123> : !s32i}> : !rec_anon_struct +// CHECK-DAG: g2 = #cir.const_array<[#cir.global_view<@g1, [4]> : !cir.ptr, #cir.global_view<@g1, [4]> : !cir.ptr, #cir.global_view<@g1, [4]> : !cir.ptr, #cir.global_view<@g1, [4]> : !cir.ptr]> : !cir.array x 4> // CHECK-DAG: g3 = #cir.global_view<@g2, [1 : i32]> : !cir.ptr> // CHECK-DAG: g4 = #cir.global_view<@g3> : !cir.ptr>> // CHECK-DAG: g5 = #cir.global_view<@g4> : !cir.ptr>>> -// CHECK-DAG: g6 = #cir.const_array<[#cir.const_record<{#cir.int<239> : !u8i, #cir.int<10> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<9> : !s32i, #cir.int<123> : !s32i}> : !ty_anon_struct, #cir.const_record<{#cir.int<239> : !u8i, #cir.int<10> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<9> : !s32i, #cir.int<123> : !s32i}> : !ty_anon_struct]> : !cir.array +// CHECK-DAG: g6 = #cir.const_array<[#cir.const_record<{#cir.int<239> : !u8i, #cir.int<10> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<9> : !s32i, #cir.int<123> : !s32i}> : !rec_anon_struct, #cir.const_record<{#cir.int<239> : !u8i, #cir.int<10> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.int<9> : !s32i, #cir.int<123> : !s32i}> : !rec_anon_struct]> : !cir.array // CHECK-DAG: g7 = #cir.const_array<[#cir.global_view<@g6, [0, 5]> : !cir.ptr, #cir.global_view<@g6, [1, 5]> : !cir.ptr]> : !cir.array x 2> // CHECK-DAG: g8 = #cir.global_view<@g7, [1 : i32]> : !cir.ptr> @@ -67,9 +67,9 @@ typedef struct { S2 g11 = {1, 42}; int* g12 = &g11.f6; -// CHECK-DAG: g9 = #cir.const_record<{#cir.int<1> : !s8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<42> : !s32i}> : !ty_anon_struct1 {alignment = 4 : i64} +// CHECK-DAG: g9 = #cir.const_record<{#cir.int<1> : !s8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<42> : !s32i}> : !rec_anon_struct1 {alignment = 4 : i64} // CHECK-DAG: g10 = #cir.global_view<@g9, [2 : i32]> : !cir.ptr {alignment = 8 : i64} -// CHECK-DAG: g11 = #cir.const_record<{#cir.int<1> : !s8i, #cir.int<42> : !s32i}> : !ty_S2_ {alignment = 1 : i64} +// CHECK-DAG: g11 = #cir.const_record<{#cir.int<1> : !s8i, #cir.int<42> : !s32i}> : !rec_S2_ {alignment = 1 : i64} // CHECK-DAG: g12 = #cir.global_view<@g11, [1 : i32]> : !cir.ptr {alignment = 8 : i64} // LLVM-DAG: @g9 = global { i8, [3 x i8], i32 } { i8 1, [3 x i8] zeroinitializer, i32 42 }, align 4 @@ -90,8 +90,8 @@ typedef struct { static S3 g13 = {-1L,0L,1L}; static S3* g14[2][2] = {{0, &g13}, {&g13, &g13}}; -// CHECK-DAG: g13 = #cir.const_record<{#cir.int<-1> : !s16i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<0> : !s32i, #cir.int<1> : !s8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> : !ty_anon_struct3 -// CHECK-DAG: g14 = #cir.const_array<[#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@g13> : !cir.ptr]> : !cir.array x 2>, #cir.const_array<[#cir.global_view<@g13> : !cir.ptr, #cir.global_view<@g13> : !cir.ptr]> : !cir.array x 2>]> : !cir.array x 2> x 2> +// CHECK-DAG: g13 = #cir.const_record<{#cir.int<-1> : !s16i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, #cir.int<0> : !s32i, #cir.int<1> : !s8i, #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> : !rec_anon_struct3 +// CHECK-DAG: g14 = #cir.const_array<[#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@g13> : !cir.ptr]> : !cir.array x 2>, #cir.const_array<[#cir.global_view<@g13> : !cir.ptr, #cir.global_view<@g13> : !cir.ptr]> : !cir.array x 2>]> : !cir.array x 2> x 2> typedef struct { int f0; @@ -109,8 +109,8 @@ static S5 g15 = {187,1,442,{123,321}}; int* g16 = &g15.f3.f1; -// CHECK-DAG: g15 = #cir.const_record<{#cir.int<187> : !u8i, #cir.int<0> : !u8i, #cir.int<2> : !u8i, #cir.zero : !u8i, #cir.int<186> : !u8i, #cir.int<1> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.const_record<{#cir.int<123> : !s32i, #cir.int<321> : !s32i}> : !ty_S4_}> : !ty_anon_struct2 {alignment = 4 : i64} -// CHECK-DAG: g16 = #cir.global_view<@g15, [8, 1]> : !cir.ptr {alignment = 8 : i64} +// CHECK-DAG: g15 = #cir.const_record<{#cir.int<187> : !u8i, #cir.int<0> : !u8i, #cir.int<2> : !u8i, #cir.zero : !u8i, #cir.int<186> : !u8i, #cir.int<1> : !u8i, #cir.int<0> : !u8i, #cir.zero : !u8i, #cir.const_record<{#cir.int<123> : !s32i, #cir.int<321> : !s32i}> : !rec_S4_}> : !rec_anon_struct2 {alignment = 4 : i64} +// CHECK-DAG: g16 = #cir.global_view<@g15, [8, 1]> : !cir.ptr {alignment = 8 : i64} // LLVM-DAG: @g15 = internal global { i8, i8, i8, i8, i8, i8, i8, i8, %struct.S4 } { i8 -69, i8 0, i8 2, i8 0, i8 -70, i8 1, i8 0, i8 0, %struct.S4 { i32 123, i32 321 } }, align 4 // LLVM-DAG: @g16 = global ptr getelementptr inbounds ({ i8, i8, i8, i8, i8, i8, i8, i8, %struct.S4 }, ptr @g15, i32 0, i32 8, i32 1), align 8 diff --git a/clang/test/CIR/CodeGen/globals.c b/clang/test/CIR/CodeGen/globals.c index f8bf1e841a29..051f0874f255 100644 --- a/clang/test/CIR/CodeGen/globals.c +++ b/clang/test/CIR/CodeGen/globals.c @@ -57,25 +57,25 @@ const int i = 12; int i2 = i; struct { int i; } i3 = {i}; // CHECK: cir.global external @i2 = #cir.int<12> : !s32i -// CHECK: cir.global external @i3 = #cir.const_record<{#cir.int<12> : !s32i}> : !ty_anon2E3 +// CHECK: cir.global external @i3 = #cir.const_record<{#cir.int<12> : !s32i}> : !rec_anon2E3 int a[10][10][10]; int *a2 = &a[3][0][8]; struct { int *p; } a3 = {&a[3][0][8]}; // CHECK: cir.global external @a2 = #cir.global_view<@a, [3 : i32, 0 : i32, 8 : i32]> : !cir.ptr -// CHECK: cir.global external @a3 = #cir.const_record<{#cir.global_view<@a, [3 : i32, 0 : i32, 8 : i32]> : !cir.ptr}> : !ty_anon2E4 +// CHECK: cir.global external @a3 = #cir.const_record<{#cir.global_view<@a, [3 : i32, 0 : i32, 8 : i32]> : !cir.ptr}> : !rec_anon2E4 int p[10]; int *p1 = &p[0]; struct { int *x; } p2 = {&p[0]}; // CHECK: cir.global external @p1 = #cir.global_view<@p> : !cir.ptr -// CHECK: cir.global external @p2 = #cir.const_record<{#cir.global_view<@p> : !cir.ptr}> : !ty_anon2E5 +// CHECK: cir.global external @p2 = #cir.const_record<{#cir.global_view<@p> : !cir.ptr}> : !rec_anon2E5 int q[10]; int *q1 = q; struct { int *x; } q2 = {q}; // CHECK: cir.global external @q1 = #cir.global_view<@q> : !cir.ptr -// CHECK: cir.global external @q2 = #cir.const_record<{#cir.global_view<@q> : !cir.ptr}> : !ty_anon2E6 +// CHECK: cir.global external @q2 = #cir.const_record<{#cir.global_view<@q> : !cir.ptr}> : !rec_anon2E6 int foo() { extern int optind; diff --git a/clang/test/CIR/CodeGen/goto.cpp b/clang/test/CIR/CodeGen/goto.cpp index 8579720104c8..1bd3849b43df 100644 --- a/clang/test/CIR/CodeGen/goto.cpp +++ b/clang/test/CIR/CodeGen/goto.cpp @@ -291,7 +291,7 @@ void foo() { // NOFLAT: cir.func @_Z3foov() // NOFLAT: cir.scope { // NOFLAT: cir.label "label" -// NOFLAT: %0 = cir.alloca !ty_S, !cir.ptr, ["agg.tmp0"] +// NOFLAT: %0 = cir.alloca !rec_S, !cir.ptr, ["agg.tmp0"] extern "C" void action1(); extern "C" void action2(); diff --git a/clang/test/CIR/CodeGen/lambda.cpp b/clang/test/CIR/CodeGen/lambda.cpp index 8dee9d0da307..4794c618613d 100644 --- a/clang/test/CIR/CodeGen/lambda.cpp +++ b/clang/test/CIR/CodeGen/lambda.cpp @@ -9,16 +9,16 @@ void fn() { a(); } -// CHECK-DAG: !ty_A = !cir.record -// CHECK: !ty_anon2E0 = !cir.record -// CHECK-DAG: !ty_anon2E7 = !cir.record -// CHECK-DAG: !ty_anon2E8 = !cir.record}> +// CHECK-DAG: !rec_A = !cir.record +// CHECK: !rec_anon2E0 = !cir.record +// CHECK-DAG: !rec_anon2E7 = !cir.record +// CHECK-DAG: !rec_anon2E8 = !cir.record}> // CHECK-DAG: module // CHECK: cir.func lambda internal private @_ZZ2fnvENK3$_0clEv{{.*}}) extra // CHECK: cir.func @_Z2fnv() -// CHECK-NEXT: %0 = cir.alloca !ty_anon2E0, !cir.ptr, ["a"] +// CHECK-NEXT: %0 = cir.alloca !rec_anon2E0, !cir.ptr, ["a"] // CHECK: cir.call @_ZZ2fnvENK3$_0clEv // LLVM-LABEL: _ZZ2fnvENK3$_0clEv @@ -43,15 +43,15 @@ void l0() { // CHECK: cir.func lambda internal private @_ZZ2l0vENK3$_0clEv({{.*}}) extra -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK: %2 = cir.get_member %1[0] {name = "i"} : !cir.ptr -> !cir.ptr> +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: %2 = cir.get_member %1[0] {name = "i"} : !cir.ptr -> !cir.ptr> // CHECK: %3 = cir.load %2 : !cir.ptr>, !cir.ptr // CHECK: %4 = cir.load %3 : !cir.ptr, !s32i // CHECK: %5 = cir.const #cir.int<1> : !s32i // CHECK: %6 = cir.binop(add, %4, %5) nsw : !s32i -// CHECK: %7 = cir.get_member %1[0] {name = "i"} : !cir.ptr -> !cir.ptr> +// CHECK: %7 = cir.get_member %1[0] {name = "i"} : !cir.ptr -> !cir.ptr> // CHECK: %8 = cir.load %7 : !cir.ptr>, !cir.ptr // CHECK: cir.store %6, %8 : !s32i, !cir.ptr @@ -95,14 +95,14 @@ auto g() { } // CHECK-LABEL: @_Z1gv() -// CHECK: %0 = cir.alloca !ty_anon2E3, !cir.ptr, ["__retval"] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !rec_anon2E3, !cir.ptr, ["__retval"] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CHECK: %2 = cir.const #cir.int<12> : !s32i // CHECK: cir.store %2, %1 : !s32i, !cir.ptr -// CHECK: %3 = cir.get_member %0[0] {name = "i"} : !cir.ptr -> !cir.ptr> +// CHECK: %3 = cir.get_member %0[0] {name = "i"} : !cir.ptr -> !cir.ptr> // CHECK: cir.store %1, %3 : !cir.ptr, !cir.ptr> -// CHECK: %4 = cir.load %0 : !cir.ptr, !ty_anon2E3 -// CHECK: cir.return %4 : !ty_anon2E3 +// CHECK: %4 = cir.load %0 : !cir.ptr, !rec_anon2E3 +// CHECK: cir.return %4 : !rec_anon2E3 // LLVM-LABEL: @_Z1gv() // LLVM: [[retval:%.*]] = alloca %class.anon.3, i64 1, align 8 @@ -124,14 +124,14 @@ auto g2() { // Should be same as above because of NRVO // CHECK-LABEL: @_Z2g2v() -// CHECK-NEXT: %0 = cir.alloca !ty_anon2E4, !cir.ptr, ["__retval", init] {alignment = 8 : i64} +// CHECK-NEXT: %0 = cir.alloca !rec_anon2E4, !cir.ptr, ["__retval", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CHECK-NEXT: %2 = cir.const #cir.int<12> : !s32i // CHECK-NEXT: cir.store %2, %1 : !s32i, !cir.ptr -// CHECK-NEXT: %3 = cir.get_member %0[0] {name = "i"} : !cir.ptr -> !cir.ptr> +// CHECK-NEXT: %3 = cir.get_member %0[0] {name = "i"} : !cir.ptr -> !cir.ptr> // CHECK-NEXT: cir.store %1, %3 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %4 = cir.load %0 : !cir.ptr, !ty_anon2E4 -// CHECK-NEXT: cir.return %4 : !ty_anon2E4 +// CHECK-NEXT: %4 = cir.load %0 : !cir.ptr, !rec_anon2E4 +// CHECK-NEXT: cir.return %4 : !rec_anon2E4 // LLVM-LABEL: @_Z2g2v() // LLVM: [[retval:%.*]] = alloca %class.anon.4, i64 1, align 8 @@ -149,10 +149,10 @@ int f() { // CHECK-LABEL: @_Z1fv() // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK-NEXT: cir.scope { -// CHECK-NEXT: %2 = cir.alloca !ty_anon2E4, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} -// CHECK-NEXT: %3 = cir.call @_Z2g2v() : () -> !ty_anon2E4 -// CHECK-NEXT: cir.store %3, %2 : !ty_anon2E4, !cir.ptr -// CHECK-NEXT: %4 = cir.call @_ZZ2g2vENK3$_0clEv(%2) : (!cir.ptr) -> !s32i +// CHECK-NEXT: %2 = cir.alloca !rec_anon2E4, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} +// CHECK-NEXT: %3 = cir.call @_Z2g2v() : () -> !rec_anon2E4 +// CHECK-NEXT: cir.store %3, %2 : !rec_anon2E4, !cir.ptr +// CHECK-NEXT: %4 = cir.call @_ZZ2g2vENK3$_0clEv(%2) : (!cir.ptr) -> !s32i // CHECK-NEXT: cir.store %4, %0 : !s32i, !cir.ptr // CHECK-NEXT: } // CHECK-NEXT: %1 = cir.load %0 : !cir.ptr, !s32i @@ -212,8 +212,8 @@ int g3() { // 1. Use `operator int (*)(int const&)()` to retrieve the fnptr to `__invoke()`. // CHECK: %3 = cir.scope { -// CHECK: %7 = cir.alloca !ty_anon2E5, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} -// CHECK: %8 = cir.call @_ZZ2g3vENK3$_0cvPFiRKiEEv(%7) : (!cir.ptr) -> !cir.ptr) -> !s32i>> +// CHECK: %7 = cir.alloca !rec_anon2E5, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} +// CHECK: %8 = cir.call @_ZZ2g3vENK3$_0cvPFiRKiEEv(%7) : (!cir.ptr) -> !cir.ptr) -> !s32i>> // CHECK: %9 = cir.unary(plus, %8) : !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>> // CHECK: cir.yield %9 : !cir.ptr) -> !s32i>> // CHECK: } @@ -300,13 +300,13 @@ struct A { // lambda operator() in foo() // CHECK-LABEL: _ZZN1A3fooEvENKUlvE_clEv -// CHECK-SAME: ([[ARG:%.*]]: !cir.ptr -// CHECK: [[ARG_ADDR:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-SAME: ([[ARG:%.*]]: !cir.ptr +// CHECK: [[ARG_ADDR:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK: [[RETVAL_ADDR:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: cir.store [[ARG]], [[ARG_ADDR]] : !cir.ptr, !cir.ptr> -// CHECK: [[CLS_ANNO7:%.*]] = cir.load [[ARG_ADDR]] : !cir.ptr>, !cir.ptr -// CHECK: [[STRUCT_A:%.*]] = cir.get_member [[CLS_ANNO7]][0] {name = "this"} : !cir.ptr -> !cir.ptr -// CHECK: [[a:%.*]] = cir.get_member [[STRUCT_A]][0] {name = "a"} : !cir.ptr -> !cir.ptr loc(#loc70) +// CHECK: cir.store [[ARG]], [[ARG_ADDR]] : !cir.ptr, !cir.ptr> +// CHECK: [[CLS_ANNO7:%.*]] = cir.load [[ARG_ADDR]] : !cir.ptr>, !cir.ptr +// CHECK: [[STRUCT_A:%.*]] = cir.get_member [[CLS_ANNO7]][0] {name = "this"} : !cir.ptr -> !cir.ptr +// CHECK: [[a:%.*]] = cir.get_member [[STRUCT_A]][0] {name = "a"} : !cir.ptr -> !cir.ptr loc(#loc70) // CHECK: [[TMP0:%.*]] = cir.load [[a]] : !cir.ptr, !s32i // CHECK: cir.store [[TMP0]], [[RETVAL_ADDR]] : !s32i, !cir.ptr // CHECK: [[RET_VAL:%.*]] = cir.load [[RETVAL_ADDR]] : !cir.ptr, @@ -327,8 +327,8 @@ struct A { // A::foo() // CHECK-LABEL: @_ZN1A3fooEv -// CHECK: [[THIS_ARG:%.*]] = cir.alloca !ty_anon2E7, !cir.ptr, ["ref.tmp0"] {alignment = 4 : i64} -// CHECK: cir.call @_ZZN1A3fooEvENKUlvE_clEv([[THIS_ARG]]) : (!cir.ptr) -> !s32i +// CHECK: [[THIS_ARG:%.*]] = cir.alloca !rec_anon2E7, !cir.ptr, ["ref.tmp0"] {alignment = 4 : i64} +// CHECK: cir.call @_ZZN1A3fooEvENKUlvE_clEv([[THIS_ARG]]) : (!cir.ptr) -> !s32i // LLVM-LABEL: _ZN1A3fooEv // LLVM: [[this_in_foo:%.*]] = alloca %class.anon.7, i64 1, align 4 @@ -336,14 +336,14 @@ struct A { // lambda operator() in bar() // CHECK-LABEL: _ZZN1A3barEvENKUlvE_clEv -// CHECK-SAME: ([[ARG2:%.*]]: !cir.ptr -// CHECK: [[ARG2_ADDR:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-SAME: ([[ARG2:%.*]]: !cir.ptr +// CHECK: [[ARG2_ADDR:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK: [[RETVAL_ADDR:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK: cir.store [[ARG2]], [[ARG2_ADDR]] : !cir.ptr, !cir.ptr> -// CHECK: [[CLS_ANNO8:%.*]] = cir.load [[ARG2_ADDR]] : !cir.ptr>, !cir.ptr -// CHECK: [[STRUCT_A_PTR:%.*]] = cir.get_member [[CLS_ANNO8]][0] {name = "this"} : !cir.ptr -> !cir.ptr> -// CHECK: [[STRUCT_A:%.*]] = cir.load [[STRUCT_A_PTR]] : !cir.ptr>, !cir.ptr -// CHECK: [[a:%.*]] = cir.get_member [[STRUCT_A]][0] {name = "a"} : !cir.ptr -> !cir.ptr loc(#loc70) +// CHECK: cir.store [[ARG2]], [[ARG2_ADDR]] : !cir.ptr, !cir.ptr> +// CHECK: [[CLS_ANNO8:%.*]] = cir.load [[ARG2_ADDR]] : !cir.ptr>, !cir.ptr +// CHECK: [[STRUCT_A_PTR:%.*]] = cir.get_member [[CLS_ANNO8]][0] {name = "this"} : !cir.ptr -> !cir.ptr> +// CHECK: [[STRUCT_A:%.*]] = cir.load [[STRUCT_A_PTR]] : !cir.ptr>, !cir.ptr +// CHECK: [[a:%.*]] = cir.get_member [[STRUCT_A]][0] {name = "a"} : !cir.ptr -> !cir.ptr loc(#loc70) // CHECK: [[TMP0:%.*]] = cir.load [[a]] : !cir.ptr, !s32i // CHECK: cir.store [[TMP0]], [[RETVAL_ADDR]] : !s32i, !cir.ptr // CHECK: [[RET_VAL:%.*]] = cir.load [[RETVAL_ADDR]] : !cir.ptr @@ -365,7 +365,7 @@ struct A { // A::bar() // CHECK-LABEL: _ZN1A3barEv -// CHECK: [[THIS_ARG:%.*]] = cir.alloca !ty_anon2E8, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} +// CHECK: [[THIS_ARG:%.*]] = cir.alloca !rec_anon2E8, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} // CHECK: cir.call @_ZZN1A3barEvENKUlvE_clEv([[THIS_ARG]]) // LLVM-LABEL: _ZN1A3barEv @@ -381,9 +381,9 @@ int test_lambda_this1(){ // CHECK-LABEL: test_lambda_this1 // Construct A -// CHECK: cir.call @_ZN1AC1Ev([[A_THIS:%.*]]) : (!cir.ptr) -> () -// CHECK: cir.call @_ZN1A3fooEv([[A_THIS]]) : (!cir.ptr) -> !s32i -// CHECK: cir.call @_ZN1A3barEv([[A_THIS]]) : (!cir.ptr) -> !s32i +// CHECK: cir.call @_ZN1AC1Ev([[A_THIS:%.*]]) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1A3fooEv([[A_THIS]]) : (!cir.ptr) -> !s32i +// CHECK: cir.call @_ZN1A3barEv([[A_THIS]]) : (!cir.ptr) -> !s32i // LLVM-LABEL: test_lambda_this1 // LLVM: [[A_THIS:%.*]] = alloca %struct.A, i64 1, align 4 diff --git a/clang/test/CIR/CodeGen/libcall.cpp b/clang/test/CIR/CodeGen/libcall.cpp index 192b0ff13294..c8f87b3cb0a7 100644 --- a/clang/test/CIR/CodeGen/libcall.cpp +++ b/clang/test/CIR/CodeGen/libcall.cpp @@ -59,5 +59,5 @@ void t(const char* fmt, ...) { // CHECK: %10 = cir.load %1 : !cir.ptr, !u64i // CHECK: %11 = cir.load %3 : !cir.ptr>, !cir.ptr -// CHECK: %12 = cir.load %4 : !cir.ptr>, !cir.ptr +// CHECK: %12 = cir.load %4 : !cir.ptr>, !cir.ptr // CHECK: %13 = cir.call @__vsnprintf_chk(%6, %8, %9, %10, %11, %12) diff --git a/clang/test/CIR/CodeGen/lvalue-refs.cpp b/clang/test/CIR/CodeGen/lvalue-refs.cpp index 951c6b66fc72..724b15c6d3e3 100644 --- a/clang/test/CIR/CodeGen/lvalue-refs.cpp +++ b/clang/test/CIR/CodeGen/lvalue-refs.cpp @@ -6,8 +6,8 @@ struct String { void split(String &S) {} -// CHECK: cir.func @_Z5splitR6String(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["S", init, const] +// CHECK: cir.func @_Z5splitR6String(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["S", init, const] void foo() { String s; @@ -15,5 +15,5 @@ void foo() { } // CHECK: cir.func @_Z3foov() -// CHECK: %0 = cir.alloca !ty_String, !cir.ptr, ["s"] -// CHECK: cir.call @_Z5splitR6String(%0) : (!cir.ptr) -> () +// CHECK: %0 = cir.alloca !rec_String, !cir.ptr, ["s"] +// CHECK: cir.call @_Z5splitR6String(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/member-init-struct.cpp b/clang/test/CIR/CodeGen/member-init-struct.cpp index 34cb42838231..76cae2e55f04 100644 --- a/clang/test/CIR/CodeGen/member-init-struct.cpp +++ b/clang/test/CIR/CodeGen/member-init-struct.cpp @@ -15,26 +15,26 @@ struct C { C(void (C::*x)(), int y) : b(), c(y), e(x) {} }; -// CHECK-LABEL: cir.global external @x = #cir.zero : !ty_A +// CHECK-LABEL: cir.global external @x = #cir.zero : !rec_A A x; C a, b(x), c(0, 2); // CHECK-LABEL: @_ZN1CC2Ev -// CHECK: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: cir.store %{{.*}}, %[[VAL_1]] : !cir.ptr, !cir.ptr> -// CHECK: %[[VAL_2:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr -// CHECK: %[[VAL_3:.*]] = cir.get_member %[[VAL_2]][0] {name = ""} : !cir.ptr -> !cir.ptr -// CHECK: %[[VAL_4:.*]] = cir.get_member %[[VAL_3]][0] {name = "a"} : !cir.ptr -> !cir.ptr -// CHECK: %[[VAL_5:.*]] = cir.const {{.*}} : !ty_A -// CHECK: cir.store %[[VAL_5]], %[[VAL_4]] : !ty_A, !cir.ptr -// CHECK: cir.call @_ZN1AC1Ev(%[[VAL_4]]) : (!cir.ptr) -> () -// CHECK: %[[VAL_6:.*]] = cir.get_member %[[VAL_2]][1] {name = "c"} : !cir.ptr -> !cir.ptr +// CHECK: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.store %{{.*}}, %[[VAL_1]] : !cir.ptr, !cir.ptr> +// CHECK: %[[VAL_2:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr +// CHECK: %[[VAL_3:.*]] = cir.get_member %[[VAL_2]][0] {name = ""} : !cir.ptr -> !cir.ptr +// CHECK: %[[VAL_4:.*]] = cir.get_member %[[VAL_3]][0] {name = "a"} : !cir.ptr -> !cir.ptr +// CHECK: %[[VAL_5:.*]] = cir.const {{.*}} : !rec_A +// CHECK: cir.store %[[VAL_5]], %[[VAL_4]] : !rec_A, !cir.ptr +// CHECK: cir.call @_ZN1AC1Ev(%[[VAL_4]]) : (!cir.ptr) -> () +// CHECK: %[[VAL_6:.*]] = cir.get_member %[[VAL_2]][1] {name = "c"} : !cir.ptr -> !cir.ptr // CHECK: %[[VAL_7:.*]] = cir.const {{.*}}<0> : !s32i // CHECK: cir.store %[[VAL_7]], %[[VAL_6]] : !s32i, !cir.ptr -// CHECK: %[[VAL_8:.*]] = cir.get_member %[[VAL_2]][2] {name = "d"} : !cir.ptr -> !cir.ptr> +// CHECK: %[[VAL_8:.*]] = cir.get_member %[[VAL_2]][2] {name = "d"} : !cir.ptr -> !cir.ptr> // CHECK: %[[VAL_9:.*]] = cir.const {{.*}} : !cir.array // CHECK: cir.store %[[VAL_9]], %[[VAL_8]] : !cir.array, !cir.ptr> -// CHECK: %[[VAL_10:.*]] = cir.get_member %[[VAL_2]][4] {name = "e"} : !cir.ptr -> !cir.ptr in !ty_C>> -// CHECK: %[[VAL_11:.*]] = cir.const #cir.method : !cir.method in !ty_C> -// CHECK: cir.store %[[VAL_11]], %[[VAL_10]] : !cir.method in !ty_C>, !cir.ptr in !ty_C>> +// CHECK: %[[VAL_10:.*]] = cir.get_member %[[VAL_2]][4] {name = "e"} : !cir.ptr -> !cir.ptr in !rec_C>> +// CHECK: %[[VAL_11:.*]] = cir.const #cir.method : !cir.method in !rec_C> +// CHECK: cir.store %[[VAL_11]], %[[VAL_10]] : !cir.method in !rec_C>, !cir.ptr in !rec_C>> // CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/move.cpp b/clang/test/CIR/CodeGen/move.cpp index 439c74cdcf8e..ac25df2c5c90 100644 --- a/clang/test/CIR/CodeGen/move.cpp +++ b/clang/test/CIR/CodeGen/move.cpp @@ -16,7 +16,7 @@ struct string { } // std namespace -// CHECK: ![[StdString:ty_.*]] = !cir.record +// CHECK: ![[StdString:rec_.*]] = !cir.record std::string getstr(); void emplace(std::string &&s); diff --git a/clang/test/CIR/CodeGen/multi-vtable.cpp b/clang/test/CIR/CodeGen/multi-vtable.cpp index b1d6152f333f..b3595aafde32 100644 --- a/clang/test/CIR/CodeGen/multi-vtable.cpp +++ b/clang/test/CIR/CodeGen/multi-vtable.cpp @@ -30,18 +30,18 @@ int main() { return 0; } -// CIR: ![[VTypeInfoA:ty_.*]] = !cir.record, !cir.ptr}> -// CIR: ![[VTypeInfoB:ty_.*]] = !cir.record, !cir.ptr, !u32i, !u32i, !cir.ptr, !s64i, !cir.ptr, !s64i}> -// CIR: ![[VTableTypeMother:ty_.*]] = !cir.record x 4>}> -// CIR: ![[VTableTypeFather:ty_.*]] = !cir.record x 3>}> -// CIR: ![[VTableTypeChild:ty_.*]] = !cir.record x 4>, !cir.array x 3>}> -// CIR: !ty_Father = !cir.record !u32i>>>} #cir.record.decl.ast> -// CIR: !ty_Mother = !cir.record !u32i>>>} #cir.record.decl.ast> -// CIR: !ty_Child = !cir.record - -// CIR: cir.func linkonce_odr @_ZN6MotherC2Ev(%arg0: !cir.ptr +// CIR: ![[VTypeInfoA:rec_.*]] = !cir.record, !cir.ptr}> +// CIR: ![[VTypeInfoB:rec_.*]] = !cir.record, !cir.ptr, !u32i, !u32i, !cir.ptr, !s64i, !cir.ptr, !s64i}> +// CIR: ![[VTableTypeMother:rec_.*]] = !cir.record x 4>}> +// CIR: ![[VTableTypeFather:rec_.*]] = !cir.record x 3>}> +// CIR: ![[VTableTypeChild:rec_.*]] = !cir.record x 4>, !cir.array x 3>}> +// CIR: !rec_Father = !cir.record !u32i>>>} #cir.record.decl.ast> +// CIR: !rec_Mother = !cir.record !u32i>>>} #cir.record.decl.ast> +// CIR: !rec_Child = !cir.record + +// CIR: cir.func linkonce_odr @_ZN6MotherC2Ev(%arg0: !cir.ptr // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV6Mother, vtable_index = 0, address_point_index = 2) : !cir.ptr !u32i>>> -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> // CIR: cir.store %2, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: cir.return // CIR: } @@ -51,13 +51,13 @@ int main() { // LLVM-DAG: ret void // LLVM-DAG: } -// CIR: cir.func linkonce_odr @_ZN5ChildC2Ev(%arg0: !cir.ptr +// CIR: cir.func linkonce_odr @_ZN5ChildC2Ev(%arg0: !cir.ptr // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV5Child, vtable_index = 0, address_point_index = 2) : !cir.ptr !u32i>>> -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV5Child, vtable_index = 1, address_point_index = 2) : !cir.ptr !u32i>>> -// CIR: %7 = cir.base_class_addr(%1 : !cir.ptr nonnull) [8] -> !cir.ptr -// CIR: %8 = cir.cast(bitcast, %7 : !cir.ptr), !cir.ptr !u32i>>>> loc(#loc8) +// CIR: %7 = cir.base_class_addr(%1 : !cir.ptr nonnull) [8] -> !cir.ptr +// CIR: %8 = cir.cast(bitcast, %7 : !cir.ptr), !cir.ptr !u32i>>>> loc(#loc8) // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: cir.return // CIR: } @@ -75,9 +75,9 @@ int main() { // CIR: cir.func @main() -> !s32i extra(#fn_attr) { -// CIR: %{{[0-9]+}} = cir.vtable.address_point( %{{[0-9]+}} : !cir.ptr)>>>, vtable_index = 0, address_point_index = 0) : !cir.ptr)>>> +// CIR: %{{[0-9]+}} = cir.vtable.address_point( %{{[0-9]+}} : !cir.ptr)>>>, vtable_index = 0, address_point_index = 0) : !cir.ptr)>>> -// CIR: %{{[0-9]+}} = cir.vtable.address_point( %{{[0-9]+}} : !cir.ptr)>>>, vtable_index = 0, address_point_index = 0) : !cir.ptr)>>> +// CIR: %{{[0-9]+}} = cir.vtable.address_point( %{{[0-9]+}} : !cir.ptr)>>>, vtable_index = 0, address_point_index = 0) : !cir.ptr)>>> // CIR: } @@ -118,7 +118,7 @@ int main() { // LLVM-DAG: @_ZTS6Father = linkonce_odr global [7 x i8] c"6Father", comdat // typeinfo for Father -// CIR: cir.global constant external @_ZTI6Father = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS6Father> : !cir.ptr}> : !ty_anon_struct {alignment = 8 : i64} +// CIR: cir.global constant external @_ZTI6Father = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS6Father> : !cir.ptr}> : !rec_anon_struct {alignment = 8 : i64} // LLVM-DAG: @_ZTI6Father = constant { ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i32 2), ptr @_ZTS6Father } // typeinfo for Child diff --git a/clang/test/CIR/CodeGen/new.cpp b/clang/test/CIR/CodeGen/new.cpp index 9a6bc33d4051..30974ae353c7 100644 --- a/clang/test/CIR/CodeGen/new.cpp +++ b/clang/test/CIR/CodeGen/new.cpp @@ -14,19 +14,19 @@ void m(int a, int b) { // CHECK: cir.func linkonce_odr @_ZSt11make_sharedI1SJRiS1_EESt10shared_ptrIT_EDpOT0_( // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["args", init, const] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["args", init, const] {alignment = 8 : i64} -// CHECK: %2 = cir.alloca !ty_std3A3Ashared_ptr3CS3E, !cir.ptr, ["__retval"] {alignment = 1 : i64} +// CHECK: %2 = cir.alloca !rec_std3A3Ashared_ptr3CS3E, !cir.ptr, ["__retval"] {alignment = 1 : i64} // CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> // CHECK: cir.scope { // CHECK: %4 = cir.const #cir.int<1> : !u64i // CHECK: %5 = cir.call @_Znwm(%4) : (!u64i) -> !cir.ptr -// CHECK: %6 = cir.cast(bitcast, %5 : !cir.ptr), !cir.ptr +// CHECK: %6 = cir.cast(bitcast, %5 : !cir.ptr), !cir.ptr // CHECK: %7 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK: %8 = cir.load %7 : !cir.ptr, !s32i // CHECK: %9 = cir.load %1 : !cir.ptr>, !cir.ptr // CHECK: %10 = cir.load %9 : !cir.ptr, !s32i -// CHECK: cir.call @_ZN1SC1Eii(%6, %8, %10) : (!cir.ptr, !s32i, !s32i) -> () -// CHECK: cir.call @_ZNSt10shared_ptrI1SEC1EPS0_(%2, %6) : (!cir.ptr, !cir.ptr) -> () +// CHECK: cir.call @_ZN1SC1Eii(%6, %8, %10) : (!cir.ptr, !s32i, !s32i) -> () +// CHECK: cir.call @_ZNSt10shared_ptrI1SEC1EPS0_(%2, %6) : (!cir.ptr, !cir.ptr) -> () // CHECK: } class B { @@ -36,19 +36,19 @@ class B { } }; -// CHECK: cir.func linkonce_odr @_ZN1B9constructEPS_(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["__p", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> -// CHECK: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: cir.func linkonce_odr @_ZN1B9constructEPS_(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["__p", init] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: cir.store %arg1, %1 : !cir.ptr, !cir.ptr> +// CHECK: %2 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK: %3 = cir.const #cir.int<1> : !u64i -// CHECK: %4 = cir.load %1 : !cir.ptr>, !cir.ptr -// CHECK: %5 = cir.cast(bitcast, %4 : !cir.ptr), !cir.ptr -// CHECK: %6 = cir.cast(bitcast, %5 : !cir.ptr), !cir.ptr +// CHECK: %4 = cir.load %1 : !cir.ptr>, !cir.ptr +// CHECK: %5 = cir.cast(bitcast, %4 : !cir.ptr), !cir.ptr +// CHECK: %6 = cir.cast(bitcast, %5 : !cir.ptr), !cir.ptr // cir.call @B::B()(%new_placament_ptr) -// CHECK: cir.call @_ZN1BC1Ev(%6) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1BC1Ev(%6) : (!cir.ptr) -> () // CHECK: cir.return // CHECK: } @@ -101,7 +101,7 @@ void t_constant_size_nontrivial() { } // CHECK: cir.func @_Z26t_constant_size_nontrivialv() -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i // CHECK: %[[SIZE_WITHOUT_COOKIE:.*]] = cir.const #cir.int<3> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<11> : !u64i @@ -111,8 +111,8 @@ void t_constant_size_nontrivial() { // CHECK: %6 = cir.cast(bitcast, %4 : !cir.ptr), !cir.ptr // CHECK: %[[COOKIE_SIZE:.*]] = cir.const #cir.int<8> : !s32i // CHECK: %8 = cir.ptr_stride(%6 : !cir.ptr, %[[COOKIE_SIZE]] : !s32i), !cir.ptr -// CHECK: %9 = cir.cast(bitcast, %8 : !cir.ptr), !cir.ptr -// CHECK: cir.store %9, %0 : !cir.ptr, !cir.ptr> +// CHECK: %9 = cir.cast(bitcast, %8 : !cir.ptr), !cir.ptr +// CHECK: cir.store %9, %0 : !cir.ptr, !cir.ptr> // CHECK: cir.return // CHECK: } @@ -130,7 +130,7 @@ void t_constant_size_nontrivial2() { // an initializer. // CHECK: cir.func @_Z27t_constant_size_nontrivial2v() -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i // CHECK: %[[SIZE_WITHOUT_COOKIE:.*]] = cir.const #cir.int<12> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<20> : !u64i @@ -140,8 +140,8 @@ void t_constant_size_nontrivial2() { // CHECK: %6 = cir.cast(bitcast, %4 : !cir.ptr), !cir.ptr // CHECK: %[[COOKIE_SIZE:.*]] = cir.const #cir.int<8> : !s32i // CHECK: %8 = cir.ptr_stride(%6 : !cir.ptr, %[[COOKIE_SIZE]] : !s32i), !cir.ptr -// CHECK: %9 = cir.cast(bitcast, %8 : !cir.ptr), !cir.ptr -// CHECK: cir.store %9, %0 : !cir.ptr, !cir.ptr> +// CHECK: %9 = cir.cast(bitcast, %8 : !cir.ptr), !cir.ptr +// CHECK: cir.store %9, %0 : !cir.ptr, !cir.ptr> // CHECK: cir.return // CHECK: } diff --git a/clang/test/CIR/CodeGen/ofstream.cpp b/clang/test/CIR/CodeGen/ofstream.cpp index bd7978fe2b81..203180d24b77 100644 --- a/clang/test/CIR/CodeGen/ofstream.cpp +++ b/clang/test/CIR/CodeGen/ofstream.cpp @@ -26,12 +26,12 @@ void foo(const char *path) { } // CIR: cir.func @_Z3fooPKc -// CIR: %[[V1:.*]] = cir.alloca !ty_std3A3Abasic_ofstream3Cchar3E, !cir.ptr, ["fout1", init] {alignment = 1 : i64} -// CIR: %[[V2:.*]] = cir.alloca !ty_std3A3Abasic_ofstream3Cchar3E, !cir.ptr, ["fout2", init] {alignment = 1 : i64} +// CIR: %[[V1:.*]] = cir.alloca !rec_std3A3Abasic_ofstream3Cchar3E, !cir.ptr, ["fout1", init] {alignment = 1 : i64} +// CIR: %[[V2:.*]] = cir.alloca !rec_std3A3Abasic_ofstream3Cchar3E, !cir.ptr, ["fout2", init] {alignment = 1 : i64} // CIR: cir.try synthetic cleanup { -// CIR: cir.call exception @_ZNSbIcEC1EPKcRKNS_9AllocatorE({{.*}}, {{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { -// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V2]]) : (!cir.ptr) -> () -// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V1]]) : (!cir.ptr) -> () +// CIR: cir.call exception @_ZNSbIcEC1EPKcRKNS_9AllocatorE({{.*}}, {{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { +// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V2]]) : (!cir.ptr) -> () +// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V1]]) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } // CIR: cir.yield @@ -39,19 +39,19 @@ void foo(const char *path) { // CIR: cir.resume // CIR: }] // CIR: cir.try synthetic cleanup { -// CIR: %[[V10:.*]] = cir.call exception @_ZStlsRSt14basic_ofstreamIcERKSbIcE(%[[V2]], {{.*}}) : (!cir.ptr, !cir.ptr) -> !cir.ptr cleanup { -// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () -// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V2]]) : (!cir.ptr) -> () -// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V1]]) : (!cir.ptr) -> () +// CIR: %[[V10:.*]] = cir.call exception @_ZStlsRSt14basic_ofstreamIcERKSbIcE(%[[V2]], {{.*}}) : (!cir.ptr, !cir.ptr) -> !cir.ptr cleanup { +// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () +// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V2]]) : (!cir.ptr) -> () +// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V1]]) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } -// CIR: cir.store %[[V10]], {{.*}} : !cir.ptr, !cir.ptr> +// CIR: cir.store %[[V10]], {{.*}} : !cir.ptr, !cir.ptr> // CIR: cir.yield // CIR: } catch [#cir.unwind { // CIR: cir.resume // CIR: }] -// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V2]]) : (!cir.ptr) -> () -// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V1]]) : (!cir.ptr) -> () +// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V2]]) : (!cir.ptr) -> () +// CIR: cir.call @_ZNSt14basic_ofstreamIcED1Ev(%[[V1]]) : (!cir.ptr) -> () // CIR: cir.return // LLVM: @_Z3fooPKc(ptr {{.*}}) diff --git a/clang/test/CIR/CodeGen/packed-structs.c b/clang/test/CIR/CodeGen/packed-structs.c index c2c9121a408a..b73e9532da2b 100644 --- a/clang/test/CIR/CodeGen/packed-structs.c +++ b/clang/test/CIR/CodeGen/packed-structs.c @@ -22,16 +22,16 @@ typedef struct { } __attribute__((aligned(2))) C; -// CIR: !ty_A = !cir.record -// CIR: !ty_C = !cir.record -// CIR: !ty_D = !cir.record}> -// CIR: !ty_I = !cir.record +// CIR: !rec_C = !cir.record +// CIR: !rec_D = !cir.record}> +// CIR: !rec_I = !cir.record // LLVM: %struct.B = type <{ i32, i8, [6 x %struct.A] }> @@ -45,9 +45,9 @@ typedef struct { // LLVM: %struct.H = type { i32, %union.anon.{{.*}} } // CIR: cir.func {{.*@foo()}} -// CIR: {{.*}} = cir.alloca !ty_A, !cir.ptr, ["a"] {alignment = 1 : i64} -// CIR: {{.*}} = cir.alloca !ty_B, !cir.ptr, ["b"] {alignment = 1 : i64} -// CIR: {{.*}} = cir.alloca !ty_C, !cir.ptr, ["c"] {alignment = 2 : i64} +// CIR: {{.*}} = cir.alloca !rec_A, !cir.ptr, ["a"] {alignment = 1 : i64} +// CIR: {{.*}} = cir.alloca !rec_B, !cir.ptr, ["b"] {alignment = 1 : i64} +// CIR: {{.*}} = cir.alloca !rec_C, !cir.ptr, ["c"] {alignment = 2 : i64} // LLVM: {{.*}} = alloca %struct.A, i64 1, align 1 // LLVM: {{.*}} = alloca %struct.B, i64 1, align 1 @@ -71,7 +71,7 @@ typedef struct { } E; // CIR: cir.func {{.*@f1()}} -// CIR: {{.*}} = cir.alloca !ty_E, !cir.ptr, ["a"] {alignment = 2 : i64} +// CIR: {{.*}} = cir.alloca !rec_E, !cir.ptr, ["a"] {alignment = 2 : i64} // LLVM: {{.*}} = alloca %struct.E, i64 1, align 2 void f1() { @@ -91,7 +91,7 @@ typedef struct { } G; // CIR: cir.func {{.*@f2()}} -// CIR: {{.*}} = cir.alloca !ty_G, !cir.ptr, ["a"] {alignment = 1 : i64} +// CIR: {{.*}} = cir.alloca !rec_G, !cir.ptr, ["a"] {alignment = 1 : i64} // LLVM: {{.*}} = alloca %struct.G, i64 1, align 1 void f2() { @@ -123,7 +123,7 @@ typedef struct { } J; // CIR: cir.func {{.*@f3()}} -// CIR: {{.*}} = cir.alloca !ty_J, !cir.ptr, ["a"] {alignment = 1 : i64} +// CIR: {{.*}} = cir.alloca !rec_J, !cir.ptr, ["a"] {alignment = 1 : i64} // LLVM: {{.*}} = alloca %struct.J, i64 1, align 1 void f3() { diff --git a/clang/test/CIR/CodeGen/pointer-to-data-member-cast.cpp b/clang/test/CIR/CodeGen/pointer-to-data-member-cast.cpp index afabaf54ff95..19cb05cd2a73 100644 --- a/clang/test/CIR/CodeGen/pointer-to-data-member-cast.cpp +++ b/clang/test/CIR/CodeGen/pointer-to-data-member-cast.cpp @@ -19,7 +19,7 @@ struct Derived : Base1, Base2 { // LLVM-LABEL: @_Z15base_to_derivedM5Base2i auto base_to_derived(int Base2::*ptr) -> int Derived::* { return ptr; - // CIR: %{{.+}} = cir.derived_data_member(%{{.+}} : !cir.data_member) [4] -> !cir.data_member + // CIR: %{{.+}} = cir.derived_data_member(%{{.+}} : !cir.data_member) [4] -> !cir.data_member // LLVM: %[[#src:]] = load i64, ptr %{{.+}} // LLVM-NEXT: %[[#is_null:]] = icmp eq i64 %[[#src]], -1 @@ -31,7 +31,7 @@ auto base_to_derived(int Base2::*ptr) -> int Derived::* { // LLVM-LABEL: @_Z15derived_to_baseM7Derivedi auto derived_to_base(int Derived::*ptr) -> int Base2::* { return static_cast(ptr); - // CIR: %{{.+}} = cir.base_data_member(%{{.+}} : !cir.data_member) [4] -> !cir.data_member + // CIR: %{{.+}} = cir.base_data_member(%{{.+}} : !cir.data_member) [4] -> !cir.data_member // LLVM: %[[#src:]] = load i64, ptr %{{.+}} // LLVM-NEXT: %[[#is_null:]] = icmp eq i64 %[[#src]], -1 @@ -43,7 +43,7 @@ auto derived_to_base(int Derived::*ptr) -> int Base2::* { // LLVM-LABEL: @_Z27base_to_derived_zero_offsetM5Base1i auto base_to_derived_zero_offset(int Base1::*ptr) -> int Derived::* { return ptr; - // CIR: %{{.+}} = cir.derived_data_member(%{{.+}} : !cir.data_member) [0] -> !cir.data_member + // CIR: %{{.+}} = cir.derived_data_member(%{{.+}} : !cir.data_member) [0] -> !cir.data_member // No LLVM instructions emitted for performing a zero-offset cast. // LLVM-NEXT: %[[#src_slot:]] = alloca i64, i64 1 @@ -59,7 +59,7 @@ auto base_to_derived_zero_offset(int Base1::*ptr) -> int Derived::* { // LLVM-LABEL: @_Z27derived_to_base_zero_offsetM7Derivedi auto derived_to_base_zero_offset(int Derived::*ptr) -> int Base1::* { return static_cast(ptr); - // CIR: %{{.+}} = cir.base_data_member(%{{.+}} : !cir.data_member) [0] -> !cir.data_member + // CIR: %{{.+}} = cir.base_data_member(%{{.+}} : !cir.data_member) [0] -> !cir.data_member // No LLVM instructions emitted for performing a zero-offset cast. // LLVM-NEXT: %[[#src_slot:]] = alloca i64, i64 1 @@ -84,8 +84,8 @@ bool to_bool(int Foo::*x) { } // CIR-LABEL: @_Z7to_boolM3Fooi -// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member -// CIR-NEXT: %{{.+}} = cir.cast(member_ptr_to_bool, %[[#x]] : !cir.data_member), !cir.bool +// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member +// CIR-NEXT: %{{.+}} = cir.cast(member_ptr_to_bool, %[[#x]] : !cir.data_member), !cir.bool // CIR: } auto bitcast(int Foo::*x) { @@ -93,6 +93,6 @@ auto bitcast(int Foo::*x) { } // CIR-LABEL: @_Z7bitcastM3Fooi -// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member -// CIR-NEXT: %{{.+}} = cir.cast(bitcast, %[[#x]] : !cir.data_member), !cir.data_member +// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member +// CIR-NEXT: %{{.+}} = cir.cast(bitcast, %[[#x]] : !cir.data_member), !cir.data_member // CIR: } diff --git a/clang/test/CIR/CodeGen/pointer-to-data-member-cmp.cpp b/clang/test/CIR/CodeGen/pointer-to-data-member-cmp.cpp index ebcf141de32b..3dc408ab7a69 100644 --- a/clang/test/CIR/CodeGen/pointer-to-data-member-cmp.cpp +++ b/clang/test/CIR/CodeGen/pointer-to-data-member-cmp.cpp @@ -16,9 +16,9 @@ bool eq(int Foo::*x, int Foo::*y) { } // CIR-LABEL: @_Z2eqM3FooiS0_ -// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member -// CIR-NEXT: %[[#y:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member -// CIR-NEXT: %{{.+}} = cir.cmp(eq, %[[#x]], %[[#y]]) : !cir.data_member, !cir.bool +// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member +// CIR-NEXT: %[[#y:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member +// CIR-NEXT: %{{.+}} = cir.cmp(eq, %[[#x]], %[[#y]]) : !cir.data_member, !cir.bool // CIR: } // LLVM-LABEL: @_Z2eqM3FooiS0_ @@ -32,9 +32,9 @@ bool ne(int Foo::*x, int Foo::*y) { } // CIR-LABEL: @_Z2neM3FooiS0_ -// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member -// CIR-NEXT: %[[#y:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member -// CIR-NEXT: %{{.+}} = cir.cmp(ne, %[[#x]], %[[#y]]) : !cir.data_member, !cir.bool +// CIR: %[[#x:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member +// CIR-NEXT: %[[#y:]] = cir.load %{{.+}} : !cir.ptr>, !cir.data_member +// CIR-NEXT: %{{.+}} = cir.cmp(ne, %[[#x]], %[[#y]]) : !cir.data_member, !cir.bool // CIR: } // LLVM-LABEL: @_Z2neM3FooiS0_ diff --git a/clang/test/CIR/CodeGen/pointer-to-data-member.cpp b/clang/test/CIR/CodeGen/pointer-to-data-member.cpp index f8acbcde325d..72cf4015fcf7 100644 --- a/clang/test/CIR/CodeGen/pointer-to-data-member.cpp +++ b/clang/test/CIR/CodeGen/pointer-to-data-member.cpp @@ -6,57 +6,57 @@ struct Point { int y; int z; }; -// CHECK-DAG: !ty_Point = !cir.record +// CHECK-DAG: !rec_Incomplete = !cir.record int Point::*pt_member = &Point::x; -// CHECK: cir.global external @pt_member = #cir.data_member<0> : !cir.data_member +// CHECK: cir.global external @pt_member = #cir.data_member<0> : !cir.data_member auto test1() -> int Point::* { return &Point::y; } -// CHECK: cir.func @_Z5test1v() -> !cir.data_member -// CHECK: %{{.+}} = cir.const #cir.data_member<1> : !cir.data_member +// CHECK: cir.func @_Z5test1v() -> !cir.data_member +// CHECK: %{{.+}} = cir.const #cir.data_member<1> : !cir.data_member // CHECK: } int test2(const Point &pt, int Point::*member) { return pt.*member; } // CHECK: cir.func @_Z5test2RK5PointMS_i -// CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr +// CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK: } int test3(const Point *pt, int Point::*member) { return pt->*member; } // CHECK: cir.func @_Z5test3PK5PointMS_i -// CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr +// CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK: } auto test4(int Incomplete::*member) -> int Incomplete::* { return member; } -// CHECK: cir.func @_Z5test4M10Incompletei(%arg0: !cir.data_member loc({{.+}})) -> !cir.data_member +// CHECK: cir.func @_Z5test4M10Incompletei(%arg0: !cir.data_member loc({{.+}})) -> !cir.data_member int test5(Incomplete *ic, int Incomplete::*member) { return ic->*member; } // CHECK: cir.func @_Z5test5P10IncompleteMS_i -// CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr +// CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK: } auto test_null() -> int Point::* { return nullptr; } // CHECK: cir.func @_Z9test_nullv -// CHECK: %{{.+}} = cir.const #cir.data_member : !cir.data_member +// CHECK: %{{.+}} = cir.const #cir.data_member : !cir.data_member // CHECK: } auto test_null_incomplete() -> int Incomplete::* { return nullptr; } // CHECK: cir.func @_Z20test_null_incompletev -// CHECK: %{{.+}} = cir.const #cir.data_member : !cir.data_member +// CHECK: %{{.+}} = cir.const #cir.data_member : !cir.data_member // CHECK: } diff --git a/clang/test/CIR/CodeGen/pointer-to-member-func.cpp b/clang/test/CIR/CodeGen/pointer-to-member-func.cpp index 458339642932..246912fd2bc0 100644 --- a/clang/test/CIR/CodeGen/pointer-to-member-func.cpp +++ b/clang/test/CIR/CodeGen/pointer-to-member-func.cpp @@ -13,8 +13,8 @@ auto make_non_virtual() -> void (Foo::*)(int) { return &Foo::m1; } -// CHECK-LABEL: cir.func @_Z16make_non_virtualv() -> !cir.method in !ty_Foo> -// CHECK: %{{.+}} = cir.const #cir.method<@_ZN3Foo2m1Ei> : !cir.method in !ty_Foo> +// CHECK-LABEL: cir.func @_Z16make_non_virtualv() -> !cir.method in !rec_Foo> +// CHECK: %{{.+}} = cir.const #cir.method<@_ZN3Foo2m1Ei> : !cir.method in !rec_Foo> // CHECK: } // LLVM-LABEL: @_Z16make_non_virtualv @@ -25,8 +25,8 @@ auto make_virtual() -> void (Foo::*)(int) { return &Foo::m3; } -// CHECK-LABEL: cir.func @_Z12make_virtualv() -> !cir.method in !ty_Foo> -// CHECK: %{{.+}} = cir.const #cir.method : !cir.method in !ty_Foo> +// CHECK-LABEL: cir.func @_Z12make_virtualv() -> !cir.method in !rec_Foo> +// CHECK: %{{.+}} = cir.const #cir.method : !cir.method in !rec_Foo> // CHECK: } // LLVM-LABEL: @_Z12make_virtualv @@ -37,8 +37,8 @@ auto make_null() -> void (Foo::*)(int) { return nullptr; } -// CHECK-LABEL: cir.func @_Z9make_nullv() -> !cir.method in !ty_Foo> -// CHECK: %{{.+}} = cir.const #cir.method : !cir.method in !ty_Foo> +// CHECK-LABEL: cir.func @_Z9make_nullv() -> !cir.method in !rec_Foo> +// CHECK: %{{.+}} = cir.const #cir.method : !cir.method in !rec_Foo> // CHECK: } // LLVM-LABEL: @_Z9make_nullv @@ -50,7 +50,7 @@ void call(Foo *obj, void (Foo::*func)(int), int arg) { } // CHECK-LABEL: cir.func @_Z4callP3FooMS_FviEi -// CHECK: %[[CALLEE:.+]], %[[THIS:.+]] = cir.get_method %{{.+}}, %{{.+}} : (!cir.method in !ty_Foo>, !cir.ptr) -> (!cir.ptr, !s32i)>>, !cir.ptr) +// CHECK: %[[CALLEE:.+]], %[[THIS:.+]] = cir.get_method %{{.+}}, %{{.+}} : (!cir.method in !rec_Foo>, !cir.ptr) -> (!cir.ptr, !s32i)>>, !cir.ptr) // CHECK-NEXT: %[[#ARG:]] = cir.load %{{.+}} : !cir.ptr, !s32i // CHECK-NEXT: cir.call %[[CALLEE]](%[[THIS]], %[[#ARG]]) : (!cir.ptr, !s32i)>>, !cir.ptr, !s32i) -> () // CHECK: } @@ -84,7 +84,7 @@ bool cmp_eq(void (Foo::*lhs)(int), void (Foo::*rhs)(int)) { } // CHECK-LABEL: @_Z6cmp_eqM3FooFviES1_ -// CHECK: %{{.+}} = cir.cmp(eq, %{{.+}}, %{{.+}}) : !cir.method in !ty_Foo>, !cir.bool +// CHECK: %{{.+}} = cir.cmp(eq, %{{.+}}, %{{.+}}) : !cir.method in !rec_Foo>, !cir.bool // LLVM-LABEL: @_Z6cmp_eqM3FooFviES1_ // LLVM: %[[#lhs:]] = load { i64, i64 }, ptr %{{.+}} @@ -104,7 +104,7 @@ bool cmp_ne(void (Foo::*lhs)(int), void (Foo::*rhs)(int)) { } // CHECK-LABEL: @_Z6cmp_neM3FooFviES1_ -// CHECK: %{{.+}} = cir.cmp(ne, %{{.+}}, %{{.+}}) : !cir.method in !ty_Foo>, !cir.bool +// CHECK: %{{.+}} = cir.cmp(ne, %{{.+}}, %{{.+}}) : !cir.method in !rec_Foo>, !cir.bool // LLVM-LABEL: @_Z6cmp_neM3FooFviES1_ // LLVM: %[[#lhs:]] = load { i64, i64 }, ptr %{{.+}} @@ -128,7 +128,7 @@ bool memfunc_to_bool(void (Foo::*func)(int)) { } // CIR-LABEL: @_Z15memfunc_to_boolM3FooFviE -// CIR: %{{.+}} = cir.cast(member_ptr_to_bool, %{{.+}} : !cir.method in !ty_Foo>), !cir.bool +// CIR: %{{.+}} = cir.cast(member_ptr_to_bool, %{{.+}} : !cir.method in !rec_Foo>), !cir.bool // CIR: } // LLVM-LABEL: @_Z15memfunc_to_boolM3FooFviE @@ -142,7 +142,7 @@ auto memfunc_reinterpret(void (Foo::*func)(int)) -> void (Bar::*)() { } // CIR-LABEL: @_Z19memfunc_reinterpretM3FooFviE -// CIR: %{{.+}} = cir.cast(bitcast, %{{.+}} : !cir.method in !ty_Foo>), !cir.method in !ty_Bar> +// CIR: %{{.+}} = cir.cast(bitcast, %{{.+}} : !cir.method in !rec_Foo>), !cir.method in !rec_Bar> // CIR: } // LLVM-LABEL: @_Z19memfunc_reinterpretM3FooFviE @@ -178,7 +178,7 @@ DerivedMemFunc base_to_derived_zero_offset(Base1MemFunc ptr) { } // CIR-LABEL: @_Z27base_to_derived_zero_offsetM5Base1FviE -// CIR: %{{.+}} = cir.derived_method(%{{.+}} : !cir.method in !ty_Base1_>) [0] -> !cir.method in !ty_Derived> +// CIR: %{{.+}} = cir.derived_method(%{{.+}} : !cir.method in !rec_Base1_>) [0] -> !cir.method in !rec_Derived> // LLVM-LABEL: @_Z27base_to_derived_zero_offsetM5Base1FviE // LLVM-NEXT: %[[#arg_slot:]] = alloca { i64, i64 }, i64 1 @@ -195,7 +195,7 @@ DerivedMemFunc base_to_derived(Base2MemFunc ptr) { } // CIR-LABEL: @_Z15base_to_derivedM5Base2FviE -// CIR: %{{.+}} = cir.derived_method(%{{.+}} : !cir.method in !ty_Base2_>) [16] -> !cir.method in !ty_Derived> +// CIR: %{{.+}} = cir.derived_method(%{{.+}} : !cir.method in !rec_Base2_>) [16] -> !cir.method in !rec_Derived> // LLVM-LABEL: @_Z15base_to_derivedM5Base2FviE // LLVM: %[[#arg:]] = load { i64, i64 }, ptr %{{.+}} @@ -208,7 +208,7 @@ Base1MemFunc derived_to_base_zero_offset(DerivedMemFunc ptr) { } // CIR-LABEL: @_Z27derived_to_base_zero_offsetM7DerivedFviE -// CIR: %{{.+}} = cir.base_method(%{{.+}} : !cir.method in !ty_Derived>) [0] -> !cir.method in !ty_Base1_> +// CIR: %{{.+}} = cir.base_method(%{{.+}} : !cir.method in !rec_Derived>) [0] -> !cir.method in !rec_Base1_> // LLVM-LABEL: @_Z27derived_to_base_zero_offsetM7DerivedFviE // LLVM-NEXT: %[[#arg_slot:]] = alloca { i64, i64 }, i64 1 @@ -225,7 +225,7 @@ Base2MemFunc derived_to_base(DerivedMemFunc ptr) { } // CIR-LABEL: @_Z15derived_to_baseM7DerivedFviE -// CIR: %{{.+}} = cir.base_method(%{{.+}} : !cir.method in !ty_Derived>) [16] -> !cir.method in !ty_Base2_> +// CIR: %{{.+}} = cir.base_method(%{{.+}} : !cir.method in !rec_Derived>) [16] -> !cir.method in !rec_Base2_> // LLVM-LABEL: @_Z15derived_to_baseM7DerivedFviE // LLVM: %[[#arg:]] = load { i64, i64 }, ptr %{{.+}} diff --git a/clang/test/CIR/CodeGen/rangefor.cpp b/clang/test/CIR/CodeGen/rangefor.cpp index 511fc0e0da36..59943a9ed9a7 100644 --- a/clang/test/CIR/CodeGen/rangefor.cpp +++ b/clang/test/CIR/CodeGen/rangefor.cpp @@ -21,9 +21,9 @@ void init(unsigned numImages) { } } -// CHECK-DAG: !ty_triple = !cir.record, !u32i}> -// CHECK-DAG: ![[VEC:.*]] = !cir.record" {!cir.ptr, !cir.ptr, !cir.ptr}> -// CHECK-DAG: ![[VEC_IT:.*]] = !cir.record" {!cir.ptr}> +// CHECK-DAG: !rec_triple = !cir.record, !u32i}> +// CHECK-DAG: ![[VEC:.*]] = !cir.record" {!cir.ptr, !cir.ptr, !cir.ptr}> +// CHECK-DAG: ![[VEC_IT:.*]] = !cir.record" {!cir.ptr}> // CHECK: cir.func @_Z4initj(%arg0: !u32i // CHECK: %0 = cir.alloca !u32i, !cir.ptr, ["numImages", init] {alignment = 4 : i64} @@ -36,7 +36,7 @@ void init(unsigned numImages) { // CHECK: %4 = cir.alloca !cir.ptr, !cir.ptr>, ["__range1", init, const] {alignment = 8 : i64} // CHECK: %5 = cir.alloca ![[VEC_IT]], !cir.ptr, ["__begin1", init] {alignment = 8 : i64} // CHECK: %6 = cir.alloca ![[VEC_IT]], !cir.ptr, ["__end1", init] {alignment = 8 : i64} -// CHECK: %7 = cir.alloca !cir.ptr, !cir.ptr>, ["image", init, const] {alignment = 8 : i64} +// CHECK: %7 = cir.alloca !cir.ptr, !cir.ptr>, ["image", init, const] {alignment = 8 : i64} // CHECK: cir.store %1, %4 : !cir.ptr, !cir.ptr> // CHECK: %8 = cir.load %4 : !cir.ptr>, !cir.ptr // CHECK: %9 = cir.call @_ZNSt6vectorI6tripleE5beginEv(%8) : (!cir.ptr) -> ![[VEC_IT]] @@ -48,19 +48,19 @@ void init(unsigned numImages) { // CHECK: %12 = cir.call @_ZNK17__vector_iteratorI6triplePS0_RS0_EneERKS3_(%5, %6) : (!cir.ptr, !cir.ptr) -> !cir.bool // CHECK: cir.condition(%12) // CHECK: } body { -// CHECK: %12 = cir.call @_ZNK17__vector_iteratorI6triplePS0_RS0_EdeEv(%5) : (!cir.ptr) -> !cir.ptr -// CHECK: cir.store %12, %7 : !cir.ptr, !cir.ptr> +// CHECK: %12 = cir.call @_ZNK17__vector_iteratorI6triplePS0_RS0_EdeEv(%5) : (!cir.ptr) -> !cir.ptr +// CHECK: cir.store %12, %7 : !cir.ptr, !cir.ptr> // CHECK: cir.scope { -// CHECK: %13 = cir.alloca !ty_triple, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} -// CHECK: %14 = cir.const #cir.zero : !ty_triple -// CHECK: cir.store %14, %13 : !ty_triple, !cir.ptr -// CHECK: %15 = cir.get_member %13[0] {name = "type"} : !cir.ptr -> !cir.ptr +// CHECK: %13 = cir.alloca !rec_triple, !cir.ptr, ["ref.tmp0"] {alignment = 8 : i64} +// CHECK: %14 = cir.const #cir.zero : !rec_triple +// CHECK: cir.store %14, %13 : !rec_triple, !cir.ptr +// CHECK: %15 = cir.get_member %13[0] {name = "type"} : !cir.ptr -> !cir.ptr // CHECK: %16 = cir.const #cir.int<1000024002> : !u32i // CHECK: cir.store %16, %15 : !u32i, !cir.ptr -// CHECK: %17 = cir.get_member %13[1] {name = "next"} : !cir.ptr -> !cir.ptr> -// CHECK: %18 = cir.get_member %13[2] {name = "image"} : !cir.ptr -> !cir.ptr -// CHECK: %19 = cir.load %7 : !cir.ptr>, !cir.ptr -// CHECK: %20 = cir.call @_ZN6tripleaSEOS_(%19, %13) : (!cir.ptr, !cir.ptr) -> !cir.ptr +// CHECK: %17 = cir.get_member %13[1] {name = "next"} : !cir.ptr -> !cir.ptr> +// CHECK: %18 = cir.get_member %13[2] {name = "image"} : !cir.ptr -> !cir.ptr +// CHECK: %19 = cir.load %7 : !cir.ptr>, !cir.ptr +// CHECK: %20 = cir.call @_ZN6tripleaSEOS_(%19, %13) : (!cir.ptr, !cir.ptr) -> !cir.ptr // CHECK: } // CHECK: cir.yield // CHECK: } step { diff --git a/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp b/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp index f48602b87676..fc2a7433fb0c 100644 --- a/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp +++ b/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp @@ -15,4 +15,4 @@ void test() { // CHECK-NOT: cir.func linkonce_odr @_ZN6StringC1EPKc // CHECK: cir.func @_Z4testv() -// CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () \ No newline at end of file +// CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/static.cpp b/clang/test/CIR/CodeGen/static.cpp index 657396845e13..1dc07df2c1ea 100644 --- a/clang/test/CIR/CodeGen/static.cpp +++ b/clang/test/CIR/CodeGen/static.cpp @@ -17,23 +17,23 @@ static Init __ioinit(true); static Init __ioinit2(false); // BEFORE: module {{.*}} { -// BEFORE-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr, !cir.bool) -// BEFORE-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr) -// BEFORE-NEXT: cir.global "private" internal dsolocal @_ZL8__ioinit = ctor : !ty_Init { -// BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr +// BEFORE-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr, !cir.bool) +// BEFORE-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr) +// BEFORE-NEXT: cir.global "private" internal dsolocal @_ZL8__ioinit = ctor : !rec_Init { +// BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr // BEFORE-NEXT: %1 = cir.const #true -// BEFORE-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () +// BEFORE-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () // BEFORE-NEXT: } dtor { -// BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr -// BEFORE-NEXT: cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () +// BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr +// BEFORE-NEXT: cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () // BEFORE-NEXT: } {alignment = 1 : i64, ast = #cir.var.decl.ast} -// BEFORE: cir.global "private" internal dsolocal @_ZL9__ioinit2 = ctor : !ty_Init { -// BEFORE-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr +// BEFORE: cir.global "private" internal dsolocal @_ZL9__ioinit2 = ctor : !rec_Init { +// BEFORE-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr // BEFORE-NEXT: %1 = cir.const #false -// BEFORE-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () +// BEFORE-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () // BEFORE-NEXT: } dtor { -// BEFORE-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr -// BEFORE-NEXT: cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () +// BEFORE-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr +// BEFORE-NEXT: cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () // BEFORE-NEXT: } {alignment = 1 : i64, ast = #cir.var.decl.ast} // BEFORE-NEXT: } @@ -41,29 +41,29 @@ static Init __ioinit2(false); // AFTER: module {{.*}} attributes {{.*}}cir.global_ctors = [#cir.global_ctor<"__cxx_global_var_init", 65536>, #cir.global_ctor<"__cxx_global_var_init.1", 65536>] // AFTER-NEXT: cir.global "private" external @__dso_handle : i8 // AFTER-NEXT: cir.func private @__cxa_atexit(!cir.ptr)>>, !cir.ptr, !cir.ptr) -// AFTER-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr, !cir.bool) -// AFTER-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr) -// AFTER-NEXT: cir.global "private" internal dsolocal @_ZL8__ioinit = #cir.zero : !ty_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} +// AFTER-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr, !cir.bool) +// AFTER-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr) +// AFTER-NEXT: cir.global "private" internal dsolocal @_ZL8__ioinit = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} // AFTER-NEXT: cir.func internal private @__cxx_global_var_init() -// AFTER-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr +// AFTER-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr // AFTER-NEXT: %1 = cir.const #true -// AFTER-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () -// AFTER-NEXT: %2 = cir.get_global @_ZL8__ioinit : !cir.ptr -// AFTER-NEXT: %3 = cir.get_global @_ZN4InitD1Ev : !cir.ptr)>> -// AFTER-NEXT: %4 = cir.cast(bitcast, %3 : !cir.ptr)>>), !cir.ptr)>> -// AFTER-NEXT: %5 = cir.cast(bitcast, %2 : !cir.ptr), !cir.ptr +// AFTER-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () +// AFTER-NEXT: %2 = cir.get_global @_ZL8__ioinit : !cir.ptr +// AFTER-NEXT: %3 = cir.get_global @_ZN4InitD1Ev : !cir.ptr)>> +// AFTER-NEXT: %4 = cir.cast(bitcast, %3 : !cir.ptr)>>), !cir.ptr)>> +// AFTER-NEXT: %5 = cir.cast(bitcast, %2 : !cir.ptr), !cir.ptr // AFTER-NEXT: %6 = cir.get_global @__dso_handle : !cir.ptr // AFTER-NEXT: cir.call @__cxa_atexit(%4, %5, %6) : (!cir.ptr)>>, !cir.ptr, !cir.ptr) -> () // AFTER-NEXT: cir.return -// AFTER: cir.global "private" internal dsolocal @_ZL9__ioinit2 = #cir.zero : !ty_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} +// AFTER: cir.global "private" internal dsolocal @_ZL9__ioinit2 = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} // AFTER-NEXT: cir.func internal private @__cxx_global_var_init.1() -// AFTER-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr +// AFTER-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr // AFTER-NEXT: %1 = cir.const #false -// AFTER-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () -// AFTER-NEXT: %2 = cir.get_global @_ZL9__ioinit2 : !cir.ptr -// AFTER-NEXT: %3 = cir.get_global @_ZN4InitD1Ev : !cir.ptr)>> -// AFTER-NEXT: %4 = cir.cast(bitcast, %3 : !cir.ptr)>>), !cir.ptr)>> -// AFTER-NEXT: %5 = cir.cast(bitcast, %2 : !cir.ptr), !cir.ptr +// AFTER-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () +// AFTER-NEXT: %2 = cir.get_global @_ZL9__ioinit2 : !cir.ptr +// AFTER-NEXT: %3 = cir.get_global @_ZN4InitD1Ev : !cir.ptr)>> +// AFTER-NEXT: %4 = cir.cast(bitcast, %3 : !cir.ptr)>>), !cir.ptr)>> +// AFTER-NEXT: %5 = cir.cast(bitcast, %2 : !cir.ptr), !cir.ptr // AFTER-NEXT: %6 = cir.get_global @__dso_handle : !cir.ptr // AFTER-NEXT: cir.call @__cxa_atexit(%4, %5, %6) : (!cir.ptr)>>, !cir.ptr, !cir.ptr) -> () // AFTER-NEXT: cir.return diff --git a/clang/test/CIR/CodeGen/stmt-expr.c b/clang/test/CIR/CodeGen/stmt-expr.c index 32b0049bd0e6..9b401b09f469 100644 --- a/clang/test/CIR/CodeGen/stmt-expr.c +++ b/clang/test/CIR/CodeGen/stmt-expr.c @@ -23,13 +23,13 @@ void test2() { ({int x = 3; x; }); } struct S { int x; }; int test3() { return ({ struct S s = {1}; s; }).x; } // CHECK: @test3 -// CHECK: %[[#RETVAL:]] = cir.alloca !ty_S, !cir.ptr +// CHECK: %[[#RETVAL:]] = cir.alloca !rec_S, !cir.ptr // CHECK: cir.scope { -// CHECK: %[[#VAR:]] = cir.alloca !ty_S, !cir.ptr +// CHECK: %[[#VAR:]] = cir.alloca !rec_S, !cir.ptr // [...] -// CHECK: cir.copy %[[#VAR]] to %[[#RETVAL]] : !cir.ptr +// CHECK: cir.copy %[[#VAR]] to %[[#RETVAL]] : !cir.ptr // CHECK: } -// CHECK: %[[#RETADDR:]] = cir.get_member %1[0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: %[[#RETADDR:]] = cir.get_member %1[0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: %{{.+}} = cir.load %[[#RETADDR]] : !cir.ptr, !s32i // Expression is wrapped in an expression attribute (just ensure it does not crash). diff --git a/clang/test/CIR/CodeGen/stmt-expr.cpp b/clang/test/CIR/CodeGen/stmt-expr.cpp index 8432df4e15af..5b173a668b16 100644 --- a/clang/test/CIR/CodeGen/stmt-expr.cpp +++ b/clang/test/CIR/CodeGen/stmt-expr.cpp @@ -19,13 +19,13 @@ void test1() { } // CHECK: @_Z5test1v // CHECK: cir.scope { -// CHECK: %[[#RETVAL:]] = cir.alloca !ty_A, !cir.ptr +// CHECK: %[[#RETVAL:]] = cir.alloca !rec_A, !cir.ptr // CHECK: cir.scope { -// CHECK: %[[#VAR:]] = cir.alloca !ty_A, !cir.ptr, ["a", init] {alignment = 4 : i64} -// CHECK: cir.call @_ZN1AC1Ev(%[[#VAR]]) : (!cir.ptr) -> () -// CHECK: cir.call @_ZN1AC1ERS_(%[[#RETVAL]], %[[#VAR]]) : (!cir.ptr, !cir.ptr) -> () +// CHECK: %[[#VAR:]] = cir.alloca !rec_A, !cir.ptr, ["a", init] {alignment = 4 : i64} +// CHECK: cir.call @_ZN1AC1Ev(%[[#VAR]]) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1AC1ERS_(%[[#RETVAL]], %[[#VAR]]) : (!cir.ptr, !cir.ptr) -> () // TODO(cir): the local VAR should be destroyed here. // CHECK: } -// CHECK: cir.call @_ZN1A3FooEv(%[[#RETVAL]]) : (!cir.ptr) -> () +// CHECK: cir.call @_ZN1A3FooEv(%[[#RETVAL]]) : (!cir.ptr) -> () // TODO(cir): the temporary RETVAL should be destroyed here. // CHECK: } diff --git a/clang/test/CIR/CodeGen/struct.c b/clang/test/CIR/CodeGen/struct.c index 6a09a0195e1a..5526ee4642d5 100644 --- a/clang/test/CIR/CodeGen/struct.c +++ b/clang/test/CIR/CodeGen/struct.c @@ -22,36 +22,36 @@ void baz(void) { struct Foo f; } -// CHECK-DAG: !ty_Node = !cir.record>} #cir.record.decl.ast> -// CHECK-DAG: !ty_Bar = !cir.record -// CHECK-DAG: !ty_Foo = !cir.record -// CHECK-DAG: !ty_SLocal = !cir.record -// CHECK-DAG: !ty_SLocal2E0 = !cir.record +// CHECK-DAG: !rec_Node = !cir.record>} #cir.record.decl.ast> +// CHECK-DAG: !rec_Bar = !cir.record +// CHECK-DAG: !rec_Foo = !cir.record +// CHECK-DAG: !rec_SLocal = !cir.record +// CHECK-DAG: !rec_SLocal2E0 = !cir.record // CHECK-DAG: module {{.*}} { // CHECK: cir.func @baz() -// CHECK-NEXT: %0 = cir.alloca !ty_Bar, !cir.ptr, ["b"] {alignment = 4 : i64} -// CHECK-NEXT: %1 = cir.alloca !ty_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} +// CHECK-NEXT: %0 = cir.alloca !rec_Bar, !cir.ptr, ["b"] {alignment = 4 : i64} +// CHECK-NEXT: %1 = cir.alloca !rec_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} // CHECK-NEXT: cir.return // CHECK-NEXT: } void shouldConstInitStructs(void) { // CHECK: cir.func @shouldConstInitStructs struct Foo f = {1, 2, {3, 4}}; - // CHECK: %[[#V0:]] = cir.alloca !ty_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} - // CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr + // CHECK: %[[#V0:]] = cir.alloca !rec_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} + // CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CHECK: %[[#V2:]] = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s8i, // CHECK-SAME: #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array, // CHECK-SAME: #cir.const_record<{#cir.int<3> : !s32i, #cir.int<4> : !s8i, // CHECK-SAME: #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> - // CHECK-SAME: : !ty_anon_struct}> : !ty_anon_struct1 - // CHECK: cir.store %[[#V2]], %[[#V1]] : !ty_anon_struct1, !cir.ptr + // CHECK-SAME: : !rec_anon_struct}> : !rec_anon_struct1 + // CHECK: cir.store %[[#V2]], %[[#V1]] : !rec_anon_struct1, !cir.ptr } // Should zero-initialize uninitialized global structs. struct S { int a,b; } s; -// CHECK-DAG: cir.global external @s = #cir.zero : !ty_S +// CHECK-DAG: cir.global external @s = #cir.zero : !rec_S // Should initialize basic global structs. struct S1 { @@ -59,7 +59,7 @@ struct S1 { float f; int *p; } s1 = {1, .1, 0}; -// CHECK-DAG: cir.global external @s1 = #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<1.000000e-01> : !cir.float, #cir.ptr : !cir.ptr}> : !ty_S1 +// CHECK-DAG: cir.global external @s1 = #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<1.000000e-01> : !cir.float, #cir.ptr : !cir.ptr}> : !rec_S1 // Should initialize global nested structs. struct S2 { @@ -67,19 +67,19 @@ struct S2 { int a; } s2a; } s2 = {{1}}; -// CHECK-DAG: cir.global external @s2 = #cir.const_record<{#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S2A}> : !ty_S2 +// CHECK-DAG: cir.global external @s2 = #cir.const_record<{#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S2A}> : !rec_S2 // Should initialize global arrays of structs. struct S3 { int a; } s3[3] = {{1}, {2}, {3}}; -// CHECK-DAG: cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S3, #cir.const_record<{#cir.int<2> : !s32i}> : !ty_S3, #cir.const_record<{#cir.int<3> : !s32i}> : !ty_S3]> : !cir.array +// CHECK-DAG: cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S3, #cir.const_record<{#cir.int<2> : !s32i}> : !rec_S3, #cir.const_record<{#cir.int<3> : !s32i}> : !rec_S3]> : !cir.array void shouldCopyStructAsCallArg(struct S1 s) { // CHECK-DAG: cir.func @shouldCopyStructAsCallArg shouldCopyStructAsCallArg(s); - // CHECK-DAG: %[[#LV:]] = cir.load %{{.+}} : !cir.ptr, !ty_S1 - // CHECK-DAG: cir.call @shouldCopyStructAsCallArg(%[[#LV]]) : (!ty_S1) -> () + // CHECK-DAG: %[[#LV:]] = cir.load %{{.+}} : !cir.ptr, !rec_S1 + // CHECK-DAG: cir.call @shouldCopyStructAsCallArg(%[[#LV]]) : (!rec_S1) -> () } struct Bar shouldGenerateAndAccessStructArrays(void) { @@ -88,12 +88,12 @@ struct Bar shouldGenerateAndAccessStructArrays(void) { } // CHECK-DAG: cir.func @shouldGenerateAndAccessStructArrays // CHECK-DAG: %[[#STRIDE:]] = cir.const #cir.int<0> : !s32i -// CHECK-DAG: %[[#DARR:]] = cir.cast(array_to_ptrdecay, %{{.+}} : !cir.ptr>), !cir.ptr -// CHECK-DAG: %[[#ELT:]] = cir.ptr_stride(%[[#DARR]] : !cir.ptr, %[[#STRIDE]] : !s32i), !cir.ptr -// CHECK-DAG: cir.copy %[[#ELT]] to %{{.+}} : !cir.ptr +// CHECK-DAG: %[[#DARR:]] = cir.cast(array_to_ptrdecay, %{{.+}} : !cir.ptr>), !cir.ptr +// CHECK-DAG: %[[#ELT:]] = cir.ptr_stride(%[[#DARR]] : !cir.ptr, %[[#STRIDE]] : !s32i), !cir.ptr +// CHECK-DAG: cir.copy %[[#ELT]] to %{{.+}} : !cir.ptr // CHECK-DAG: cir.func @local_decl -// CHECK-DAG: {{%.}} = cir.alloca !ty_Local, !cir.ptr, ["a"] +// CHECK-DAG: {{%.}} = cir.alloca !rec_Local, !cir.ptr, ["a"] void local_decl(void) { struct Local { int i; @@ -102,14 +102,14 @@ void local_decl(void) { } // CHECK-DAG: cir.func @useRecursiveType -// CHECK-DAG: cir.get_member {{%.}}[0] {name = "next"} : !cir.ptr -> !cir.ptr> +// CHECK-DAG: cir.get_member {{%.}}[0] {name = "next"} : !cir.ptr -> !cir.ptr> void useRecursiveType(NodeStru* a) { a->next = 0; } -// CHECK-DAG: cir.alloca !ty_SLocal, !cir.ptr, ["loc", init] {alignment = 4 : i64} +// CHECK-DAG: cir.alloca !rec_SLocal, !cir.ptr, ["loc", init] {alignment = 4 : i64} // CHECK-DAG: cir.scope { -// CHECK-DAG: cir.alloca !ty_SLocal2E0, !cir.ptr, ["loc", init] {alignment = 4 : i64} +// CHECK-DAG: cir.alloca !rec_SLocal2E0, !cir.ptr, ["loc", init] {alignment = 4 : i64} void local_structs(int a, float b) { struct SLocal { int x; }; struct SLocal loc = {a}; diff --git a/clang/test/CIR/CodeGen/struct.cpp b/clang/test/CIR/CodeGen/struct.cpp index 894da59687d7..e217d7bc724b 100644 --- a/clang/test/CIR/CodeGen/struct.cpp +++ b/clang/test/CIR/CodeGen/struct.cpp @@ -26,37 +26,37 @@ void baz() { struct incomplete; void yoyo(incomplete *i) {} -// CHECK-DAG: !ty_incomplete = !cir.record - -// CHECK-DAG: !ty_Foo = !cir.record -// CHECK-DAG: !ty_Mandalore = !cir.record, !s32i} #cir.record.decl.ast> -// CHECK-DAG: !ty_Adv = !cir.record -// CHECK-DAG: !ty_Entry = !cir.record, !cir.ptr) -> !u32i>>}> - -// CHECK: cir.func linkonce_odr @_ZN3Bar6methodEv(%arg0: !cir.ptr -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-DAG: !rec_incomplete = !cir.record + +// CHECK-DAG: !rec_Foo = !cir.record +// CHECK-DAG: !rec_Mandalore = !cir.record, !s32i} #cir.record.decl.ast> +// CHECK-DAG: !rec_Adv = !cir.record +// CHECK-DAG: !rec_Entry = !cir.record, !cir.ptr) -> !u32i>>}> + +// CHECK: cir.func linkonce_odr @_ZN3Bar6methodEv(%arg0: !cir.ptr +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } -// CHECK: cir.func linkonce_odr @_ZN3Bar7method2Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.func linkonce_odr @_ZN3Bar7method2Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.store %arg1, %1 : !s32i, !cir.ptr -// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } -// CHECK: cir.func linkonce_odr @_ZN3Bar7method3Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i -// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.func linkonce_odr @_ZN3Bar7method3Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i +// CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK-NEXT: %2 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} -// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: cir.store %arg1, %1 : !s32i, !cir.ptr -// CHECK-NEXT: %3 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK-NEXT: %3 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK-NEXT: %4 = cir.load %1 : !cir.ptr, !s32i // CHECK-NEXT: cir.store %4, %2 : !s32i, !cir.ptr // CHECK-NEXT: %5 = cir.load %2 : !cir.ptr, !s32i @@ -64,14 +64,14 @@ void yoyo(incomplete *i) {} // CHECK-NEXT: } // CHECK: cir.func @_Z3bazv() -// CHECK-NEXT: %0 = cir.alloca !ty_Bar, !cir.ptr, ["b"] {alignment = 4 : i64} +// CHECK-NEXT: %0 = cir.alloca !rec_Bar, !cir.ptr, ["b"] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["result", init] {alignment = 4 : i64} -// CHECK-NEXT: %2 = cir.alloca !ty_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} -// CHECK-NEXT: cir.call @_ZN3Bar6methodEv(%0) : (!cir.ptr) -> () +// CHECK-NEXT: %2 = cir.alloca !rec_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} +// CHECK-NEXT: cir.call @_ZN3Bar6methodEv(%0) : (!cir.ptr) -> () // CHECK-NEXT: %3 = cir.const #cir.int<4> : !s32i -// CHECK-NEXT: cir.call @_ZN3Bar7method2Ei(%0, %3) : (!cir.ptr, !s32i) -> () +// CHECK-NEXT: cir.call @_ZN3Bar7method2Ei(%0, %3) : (!cir.ptr, !s32i) -> () // CHECK-NEXT: %4 = cir.const #cir.int<4> : !s32i -// CHECK-NEXT: %5 = cir.call @_ZN3Bar7method3Ei(%0, %4) : (!cir.ptr, !s32i) -> !s32i +// CHECK-NEXT: %5 = cir.call @_ZN3Bar7method3Ei(%0, %4) : (!cir.ptr, !s32i) -> !s32i // CHECK-NEXT: cir.store %5, %1 : !s32i, !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } @@ -94,18 +94,18 @@ class Adv { void m() { Adv C; } -// CHECK: cir.func linkonce_odr @_ZN3AdvC2Ev(%arg0: !cir.ptr -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> -// CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK: %2 = cir.get_member %1[0] {name = "x"} : !cir.ptr -> !cir.ptr -// CHECK: %3 = cir.get_member %2[0] {name = "w"} : !cir.ptr -> !cir.ptr +// CHECK: cir.func linkonce_odr @_ZN3AdvC2Ev(%arg0: !cir.ptr +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: %2 = cir.get_member %1[0] {name = "x"} : !cir.ptr -> !cir.ptr +// CHECK: %3 = cir.get_member %2[0] {name = "w"} : !cir.ptr -> !cir.ptr // CHECK: %4 = cir.const #cir.int<1000024001> : !u32i // CHECK: cir.store %4, %3 : !u32i, !cir.ptr -// CHECK: %5 = cir.get_member %2[1] {name = "n"} : !cir.ptr -> !cir.ptr> +// CHECK: %5 = cir.get_member %2[1] {name = "n"} : !cir.ptr -> !cir.ptr> // CHECK: %6 = cir.const #cir.ptr : !cir.ptr // CHECK: cir.store %6, %5 : !cir.ptr, !cir.ptr> -// CHECK: %7 = cir.get_member %2[2] {name = "d"} : !cir.ptr -> !cir.ptr +// CHECK: %7 = cir.get_member %2[2] {name = "d"} : !cir.ptr -> !cir.ptr // CHECK: %8 = cir.const #cir.int<0> : !s32i // CHECK: cir.store %8, %7 : !s32i, !cir.ptr // CHECK: cir.return @@ -117,27 +117,27 @@ struct A { // Should globally const-initialize struct members. struct A simpleConstInit = {1}; -// CHECK: cir.global external @simpleConstInit = #cir.const_record<{#cir.int<1> : !s32i}> : !ty_A +// CHECK: cir.global external @simpleConstInit = #cir.const_record<{#cir.int<1> : !s32i}> : !rec_A // Should globally const-initialize arrays with struct members. struct A arrConstInit[1] = {{1}}; -// CHECK: cir.global external @arrConstInit = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_A]> : !cir.array +// CHECK: cir.global external @arrConstInit = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_A]> : !cir.array // Should globally const-initialize empty structs with a non-trivial constexpr // constructor (as undef, to match existing clang CodeGen behavior). struct NonTrivialConstexprConstructor { constexpr NonTrivialConstexprConstructor() {} } nonTrivialConstexprConstructor; -// CHECK: cir.global external @nonTrivialConstexprConstructor = #cir.undef : !ty_NonTrivialConstexprConstructor {alignment = 1 : i64} +// CHECK: cir.global external @nonTrivialConstexprConstructor = #cir.undef : !rec_NonTrivialConstexprConstructor {alignment = 1 : i64} // CHECK-NOT: @__cxx_global_var_init // Should locally copy struct members. void shouldLocallyCopyStructAssignments(void) { struct A a = { 3 }; - // CHECK: %[[#SA:]] = cir.alloca !ty_A, !cir.ptr, ["a"] {alignment = 4 : i64} + // CHECK: %[[#SA:]] = cir.alloca !rec_A, !cir.ptr, ["a"] {alignment = 4 : i64} struct A b = a; - // CHECK: %[[#SB:]] = cir.alloca !ty_A, !cir.ptr, ["b", init] {alignment = 4 : i64} - // cir.copy %[[#SA]] to %[[SB]] : !cir.ptr + // CHECK: %[[#SB:]] = cir.alloca !rec_A, !cir.ptr, ["b", init] {alignment = 4 : i64} + // cir.copy %[[#SA]] to %[[SB]] : !cir.ptr } A get_default() { return A{2}; } @@ -149,12 +149,12 @@ struct S { void h() { S s; } // CHECK: cir.func @_Z1hv() -// CHECK: %0 = cir.alloca !ty_S, !cir.ptr, ["s", init] {alignment = 1 : i64} -// CHECK: %1 = cir.alloca !ty_A, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} -// CHECK: %2 = cir.call @_Z11get_defaultv() : () -> !ty_A -// CHECK: cir.store %2, %1 : !ty_A, !cir.ptr -// CHECK: %3 = cir.load %1 : !cir.ptr, !ty_A -// CHECK: cir.call @_ZN1SC1E1A(%0, %3) : (!cir.ptr, !ty_A) -> () +// CHECK: %0 = cir.alloca !rec_S, !cir.ptr, ["s", init] {alignment = 1 : i64} +// CHECK: %1 = cir.alloca !rec_A, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} +// CHECK: %2 = cir.call @_Z11get_defaultv() : () -> !rec_A +// CHECK: cir.store %2, %1 : !rec_A, !cir.ptr +// CHECK: %3 = cir.load %1 : !cir.ptr, !rec_A +// CHECK: cir.call @_ZN1SC1E1A(%0, %3) : (!cir.ptr, !rec_A) -> () // CHECK: cir.return // CHECK: } @@ -170,6 +170,6 @@ struct Entry { void ppp() { Entry x; } -// CHECK: cir.func linkonce_odr @_ZN5EntryC2Ev(%arg0: !cir.ptr +// CHECK: cir.func linkonce_odr @_ZN5EntryC2Ev(%arg0: !cir.ptr -// CHECK: cir.get_member %1[0] {name = "procAddr"} : !cir.ptr -> !cir.ptr, !cir.ptr) -> !u32i>>> +// CHECK: cir.get_member %1[0] {name = "procAddr"} : !cir.ptr -> !cir.ptr, !cir.ptr) -> !u32i>>> diff --git a/clang/test/CIR/CodeGen/structural-binding.cpp b/clang/test/CIR/CodeGen/structural-binding.cpp index d70a9509c6f9..026d97c2878a 100644 --- a/clang/test/CIR/CodeGen/structural-binding.cpp +++ b/clang/test/CIR/CodeGen/structural-binding.cpp @@ -49,22 +49,22 @@ void f(A &a) { auto &[x, y, z] = a; (x, y, z); - // CIR: %[[a:.*]] = cir.load %1 : !cir.ptr>, !cir.ptr - // CIR: {{.*}} = cir.get_member %[[a]][0] {name = "a"} : !cir.ptr -> !cir.ptr - // CIR: %[[a:.*]] = cir.load %1 : !cir.ptr>, !cir.ptr - // CIR: {{.*}} = cir.get_member %[[a]][2] {name = "b"} : !cir.ptr -> !cir.ptr - // CIR: %[[a:.*]] = cir.load %1 : !cir.ptr>, !cir.ptr - // CIR: {{.*}} = cir.get_member %[[a]][3] {name = "c"} : !cir.ptr -> !cir.ptr + // CIR: %[[a:.*]] = cir.load %1 : !cir.ptr>, !cir.ptr + // CIR: {{.*}} = cir.get_member %[[a]][0] {name = "a"} : !cir.ptr -> !cir.ptr + // CIR: %[[a:.*]] = cir.load %1 : !cir.ptr>, !cir.ptr + // CIR: {{.*}} = cir.get_member %[[a]][2] {name = "b"} : !cir.ptr -> !cir.ptr + // CIR: %[[a:.*]] = cir.load %1 : !cir.ptr>, !cir.ptr + // CIR: {{.*}} = cir.get_member %[[a]][3] {name = "c"} : !cir.ptr -> !cir.ptr // LLVM: {{.*}} = getelementptr %struct.A, ptr {{.*}}, i32 0, i32 0 // LLVM: {{.*}} = getelementptr %struct.A, ptr {{.*}}, i32 0, i32 2 // LLVM: {{.*}} = getelementptr %struct.A, ptr {{.*}}, i32 0, i32 3 auto [x2, y2, z2] = a; (x2, y2, z2); - // CIR: cir.call @_ZN1AC1ERKS_(%2, {{.*}}) : (!cir.ptr, !cir.ptr) -> () - // CIR: {{.*}} = cir.get_member %2[0] {name = "a"} : !cir.ptr -> !cir.ptr - // CIR: {{.*}} = cir.get_member %2[2] {name = "b"} : !cir.ptr -> !cir.ptr - // CIR: {{.*}} = cir.get_member %2[3] {name = "c"} : !cir.ptr -> !cir.ptr + // CIR: cir.call @_ZN1AC1ERKS_(%2, {{.*}}) : (!cir.ptr, !cir.ptr) -> () + // CIR: {{.*}} = cir.get_member %2[0] {name = "a"} : !cir.ptr -> !cir.ptr + // CIR: {{.*}} = cir.get_member %2[2] {name = "b"} : !cir.ptr -> !cir.ptr + // CIR: {{.*}} = cir.get_member %2[3] {name = "c"} : !cir.ptr -> !cir.ptr // for the rest, just expect the codegen does't crash auto &&[x3, y3, z3] = a; @@ -84,10 +84,10 @@ void g(C &c) { auto [x8, y8] = c; (x8, y8); - // CIR: cir.call @_ZN1CC1ERKS_(%[[c:.*]], %7) : (!cir.ptr, !cir.ptr) -> () - // CIR: %[[x8:.*]] = cir.call @_Z3getILj0EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr + // CIR: cir.call @_ZN1CC1ERKS_(%[[c:.*]], %7) : (!cir.ptr, !cir.ptr) -> () + // CIR: %[[x8:.*]] = cir.call @_Z3getILj0EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr // CIR: cir.store %[[x8]], %[[x8p:.*]] : !cir.ptr, !cir.ptr> - // CIR: %[[x9:.*]] = cir.call @_Z3getILj1EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr + // CIR: %[[x9:.*]] = cir.call @_Z3getILj1EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr // CIR: cir.store %[[x9]], %[[x9p:.*]] : !cir.ptr, !cir.ptr> // CIR: {{.*}} = cir.load %[[x8p]] : !cir.ptr>, !cir.ptr // CIR: {{.*}} = cir.load %[[x9p]] : !cir.ptr>, !cir.ptr @@ -97,12 +97,12 @@ void g(C &c) { auto &[x9, y9] = c; (x9, y9); - // CIR: cir.store %12, %[[cp:.*]] : !cir.ptr, !cir.ptr> - // CIR: %[[c:.*]] = cir.load %[[cp]] : !cir.ptr>, !cir.ptr - // CIR: %[[x8:.*]] = cir.call @_Z3getILj0EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr + // CIR: cir.store %12, %[[cp:.*]] : !cir.ptr, !cir.ptr> + // CIR: %[[c:.*]] = cir.load %[[cp]] : !cir.ptr>, !cir.ptr + // CIR: %[[x8:.*]] = cir.call @_Z3getILj0EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr // CIR: cir.store %[[x8]], %[[x8p:.*]] : !cir.ptr, !cir.ptr> - // CIR: %[[c:.*]] = cir.load %[[cp]] : !cir.ptr>, !cir.ptr - // CIR: %[[x9:.*]] = cir.call @_Z3getILj1EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr + // CIR: %[[c:.*]] = cir.load %[[cp]] : !cir.ptr>, !cir.ptr + // CIR: %[[x9:.*]] = cir.call @_Z3getILj1EERKiRK1C(%[[c]]) : (!cir.ptr) -> !cir.ptr // CIR: cir.store %[[x9]], %[[x9p:.*]] : !cir.ptr, !cir.ptr> // CIR: {{.*}} = cir.load %[[x8p]] : !cir.ptr>, !cir.ptr // CIR: {{.*}} = cir.load %[[x9p]] : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/synthetic-try-resume.cpp b/clang/test/CIR/CodeGen/synthetic-try-resume.cpp index 69a407dcb31e..2d35958c5848 100644 --- a/clang/test/CIR/CodeGen/synthetic-try-resume.cpp +++ b/clang/test/CIR/CodeGen/synthetic-try-resume.cpp @@ -15,8 +15,8 @@ void foo(const char* path) { } // CIR: cir.try synthetic cleanup { -// CIR: cir.call exception @_ZNSbIcEC1EPKcRKNS_9AllocatorE({{.*}}, {{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { -// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () +// CIR: cir.call exception @_ZNSbIcEC1EPKcRKNS_9AllocatorE({{.*}}, {{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () cleanup { +// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } // CIR: cir.yield @@ -24,30 +24,30 @@ void foo(const char* path) { // CIR: cir.resume // CIR: }] // CIR: cir.try synthetic cleanup { -// CIR: {{.*}} = cir.call exception @_ZNSbIcEaSERKS_({{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr) -> !cir.ptr cleanup { -// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () +// CIR: {{.*}} = cir.call exception @_ZNSbIcEaSERKS_({{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr) -> !cir.ptr cleanup { +// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } -// CIR: cir.store {{.*}}, {{.*}} : !cir.ptr, !cir.ptr> +// CIR: cir.store {{.*}}, {{.*}} : !cir.ptr, !cir.ptr> // CIR: cir.yield // CIR: } catch [#cir.unwind { // CIR: cir.resume // CIR: }] -// CIR: {{.*}} = cir.load {{.*}} : !cir.ptr>, !cir.ptr -// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () +// CIR: {{.*}} = cir.load {{.*}} : !cir.ptr>, !cir.ptr +// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () // CIR: cir.try synthetic cleanup { -// CIR: cir.call exception @_ZNSbIcEC1EPKcRKNS_9AllocatorE({{.*}}, {{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () +// CIR: cir.call exception @_ZNSbIcEC1EPKcRKNS_9AllocatorE({{.*}}, {{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr, !cir.ptr) -> () // CIR: cir.yield // CIR: } catch [#cir.unwind { // CIR: cir.resume // CIR: }] // CIR: cir.try synthetic cleanup { -// CIR: {{.*}} = cir.call exception @_ZNSbIcEaSERKS_({{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr) -> !cir.ptr cleanup { -// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () -// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () +// CIR: {{.*}} = cir.call exception @_ZNSbIcEaSERKS_({{.*}}, {{.*}}) : (!cir.ptr, !cir.ptr) -> !cir.ptr cleanup { +// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () +// CIR: cir.call @_ZNSbIcED1Ev({{.*}}) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } -// CIR: cir.store {{.*}}, {{.*}} : !cir.ptr, !cir.ptr> +// CIR: cir.store {{.*}}, {{.*}} : !cir.ptr, !cir.ptr> // CIR: cir.yield // CIR: } catch [#cir.unwind { // CIR: cir.resume diff --git a/clang/test/CIR/CodeGen/tbaa-pointer.cpp b/clang/test/CIR/CodeGen/tbaa-pointer.cpp index e766aec1533d..d082f0751b9b 100644 --- a/clang/test/CIR/CodeGen/tbaa-pointer.cpp +++ b/clang/test/CIR/CodeGen/tbaa-pointer.cpp @@ -9,7 +9,7 @@ // CIR: #tbaa[[CHAR:.*]] = #cir.tbaa_omnipotent_char // CIR: #tbaa[[INT:.*]] = #cir.tbaa_scalar -// CIR: #tbaa[[PTR_TO_A:.*]] = #cir.tbaa_scalar> +// CIR: #tbaa[[PTR_TO_A:.*]] = #cir.tbaa_scalar> // CIR: #tbaa[[STRUCT_A:.*]] = #cir.tbaa_struct, <#tbaa[[INT]], 4>}> // CIR: #tbaa[[TAG_STRUCT_A_a:.*]] = #cir.tbaa_tag @@ -19,9 +19,9 @@ // CIR-POINTER-TBAA-DAG: #tbaa[[p2_INT:.*]] = #cir.tbaa_scalar> // CIR-POINTER-TBAA-DAG: #tbaa[[p3_INT:.*]] = #cir.tbaa_scalar>> // CIR-POINTER-TBAA-DAG: #tbaa[[STRUCT_A:.*]] = #cir.tbaa_struct, <#tbaa[[INT]], 4>}> -// CIR-POINTER-TBAA-DAG: #tbaa[[p1_STRUCT_A:.*]] = #cir.tbaa_scalar -// CIR-POINTER-TBAA-DAG: #tbaa[[p2_STRUCT_A:.*]] = #cir.tbaa_scalar> -// CIR-POINTER-TBAA-DAG: #tbaa[[p3_STRUCT_A:.*]] = #cir.tbaa_scalar>> +// CIR-POINTER-TBAA-DAG: #tbaa[[p1_STRUCT_A:.*]] = #cir.tbaa_scalar +// CIR-POINTER-TBAA-DAG: #tbaa[[p2_STRUCT_A:.*]] = #cir.tbaa_scalar> +// CIR-POINTER-TBAA-DAG: #tbaa[[p3_STRUCT_A:.*]] = #cir.tbaa_scalar>> int test_scalar_pointer(int*** p3) { int* p1; @@ -59,9 +59,9 @@ int test_struct_pointer(A*** p3, int A::***m3) { p1 = *p2; // CIR-POINTER-TBAA-LABEL: _Z19test_struct_pointerPPP1APPMS_i - // CIR-POINTER-TBAA: %{{.*}} = cir.load deref %{{.*}} : !cir.ptr>>>, !cir.ptr>> tbaa(#tbaa[[p3_STRUCT_A]]) - // CIR-POINTER-TBAA: %{{.*}} = cir.load deref %{{.*}} : !cir.ptr>>, !cir.ptr> tbaa(#tbaa[[p2_STRUCT_A]]) - // CIR-POINTER-TBAA: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.ptr tbaa(#tbaa[[p1_STRUCT_A]]) + // CIR-POINTER-TBAA: %{{.*}} = cir.load deref %{{.*}} : !cir.ptr>>>, !cir.ptr>> tbaa(#tbaa[[p3_STRUCT_A]]) + // CIR-POINTER-TBAA: %{{.*}} = cir.load deref %{{.*}} : !cir.ptr>>, !cir.ptr> tbaa(#tbaa[[p2_STRUCT_A]]) + // CIR-POINTER-TBAA: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.ptr tbaa(#tbaa[[p1_STRUCT_A]]) // LLVM-LABEL: _Z19test_struct_pointerPPP1APPMS_i // LLVM: %[[p2:.*]] = load ptr, ptr %{{.*}}, align 8, !tbaa ![[TBAA_ANY_PTR]] @@ -78,10 +78,10 @@ int test_struct_pointer(A*** p3, int A::***m3) { void test_member_pointer(A& a, int A::***m3, int val) { // CIR-LABEL: _Z19test_member_pointerR1APPMS_ii - // CIR: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.data_member tbaa(#tbaa[[CHAR]]) + // CIR: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.data_member tbaa(#tbaa[[CHAR]]) // CIR-POINTER-TBAA-LABEL: _Z19test_member_pointerR1APPMS_ii - // CIR-POINTER-TBAA: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.data_member tbaa(#tbaa[[CHAR]]) + // CIR-POINTER-TBAA: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.data_member tbaa(#tbaa[[CHAR]]) // LLVM-LABEL: _Z19test_member_pointerR1APPMS_ii // LLVM: %[[m2:.*]] = load ptr, ptr %{{.*}}, align 8, !tbaa ![[TBAA_ANY_PTR:.*]] diff --git a/clang/test/CIR/CodeGen/tbaa-struct.cpp b/clang/test/CIR/CodeGen/tbaa-struct.cpp index 17b05fad9fde..036b44731dc1 100644 --- a/clang/test/CIR/CodeGen/tbaa-struct.cpp +++ b/clang/test/CIR/CodeGen/tbaa-struct.cpp @@ -334,8 +334,8 @@ struct six { }; char g14(struct six *a, struct six *b) { // CIR-LABEL: cir.func @_Z3g14 - // CIR: %[[TMP1:.*]] = cir.load %{{.*}} : !cir.ptr>, !cir.ptr - // CIR: %[[TMP2:.*]] = cir.get_member %[[TMP1]][2] {name = "b"} : !cir.ptr -> !cir.ptr + // CIR: %[[TMP1:.*]] = cir.load %{{.*}} : !cir.ptr>, !cir.ptr + // CIR: %[[TMP2:.*]] = cir.get_member %[[TMP1]][2] {name = "b"} : !cir.ptr -> !cir.ptr // CIR: %[[TMP3:.*]] = cir.load %[[TMP2]] : !cir.ptr, !s8i tbaa(#tbaa[[TAG_six_b]]) // LLVM-LABEL: define{{.*}} i8 @_Z3g14 diff --git a/clang/test/CIR/CodeGen/tbaa-union.c b/clang/test/CIR/CodeGen/tbaa-union.c index b06e285bb453..f878c0e13307 100644 --- a/clang/test/CIR/CodeGen/tbaa-union.c +++ b/clang/test/CIR/CodeGen/tbaa-union.c @@ -19,7 +19,7 @@ typedef struct { void foo(S *s) { // CIR-LABEL: cir.func @foo // CIR: %[[C1:.*]] = cir.const #cir.int<1> : !s32i loc(#loc6) - // CIR: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.ptr + // CIR: %{{.*}} = cir.load %{{.*}} : !cir.ptr>, !cir.ptr // CIR: cir.store %[[C1]], %{{.*}} : !s32i, !cir.ptr tbaa(#tbaa[[CHAR]]) // LLVM-LABEL: void @foo diff --git a/clang/test/CIR/CodeGen/temporaries.cpp b/clang/test/CIR/CodeGen/temporaries.cpp index d51b6974109f..0cd19ab58d8a 100644 --- a/clang/test/CIR/CodeGen/temporaries.cpp +++ b/clang/test/CIR/CodeGen/temporaries.cpp @@ -14,18 +14,18 @@ void f() { !E(); } -// CIR: cir.func private @_ZN1EC1Ev(!cir.ptr) extra(#fn_attr) -// CIR-NEXT: cir.func private @_ZN1EntEv(!cir.ptr) -> !ty_E -// CIR-NEXT: cir.func private @_ZN1ED1Ev(!cir.ptr) extra(#fn_attr) +// CIR: cir.func private @_ZN1EC1Ev(!cir.ptr) extra(#fn_attr) +// CIR-NEXT: cir.func private @_ZN1EntEv(!cir.ptr) -> !rec_E +// CIR-NEXT: cir.func private @_ZN1ED1Ev(!cir.ptr) extra(#fn_attr) // CIR-NEXT: cir.func @_Z1fv() extra(#fn_attr1) { // CIR-NEXT: cir.scope { -// CIR-NEXT: %[[ONE:[0-9]+]] = cir.alloca !ty_E, !cir.ptr, ["agg.tmp.ensured"] {alignment = 1 : i64} -// CIR-NEXT: %[[TWO:[0-9]+]] = cir.alloca !ty_E, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} -// CIR-NEXT: cir.call @_ZN1EC1Ev(%1) : (!cir.ptr) -> () extra(#fn_attr) -// CIR-NEXT: %[[THREE:[0-9]+]] = cir.call @_ZN1EntEv(%[[TWO]]) : (!cir.ptr) -> !ty_E -// CIR-NEXT: cir.store %[[THREE]], %[[ONE]] : !ty_E, !cir.ptr -// CIR-NEXT: cir.call @_ZN1ED1Ev(%[[ONE]]) : (!cir.ptr) -> () extra(#fn_attr) -// CIR-NEXT: cir.call @_ZN1ED1Ev(%[[TWO]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR-NEXT: %[[ONE:[0-9]+]] = cir.alloca !rec_E, !cir.ptr, ["agg.tmp.ensured"] {alignment = 1 : i64} +// CIR-NEXT: %[[TWO:[0-9]+]] = cir.alloca !rec_E, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} +// CIR-NEXT: cir.call @_ZN1EC1Ev(%1) : (!cir.ptr) -> () extra(#fn_attr) +// CIR-NEXT: %[[THREE:[0-9]+]] = cir.call @_ZN1EntEv(%[[TWO]]) : (!cir.ptr) -> !rec_E +// CIR-NEXT: cir.store %[[THREE]], %[[ONE]] : !rec_E, !cir.ptr +// CIR-NEXT: cir.call @_ZN1ED1Ev(%[[ONE]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR-NEXT: cir.call @_ZN1ED1Ev(%[[TWO]]) : (!cir.ptr) -> () extra(#fn_attr) // CIR-NEXT: } // CIR-NEXT: cir.return // CIR-NEXT: } diff --git a/clang/test/CIR/CodeGen/tempref.cpp b/clang/test/CIR/CodeGen/tempref.cpp index 645b8f867cef..a06a9ae60875 100644 --- a/clang/test/CIR/CodeGen/tempref.cpp +++ b/clang/test/CIR/CodeGen/tempref.cpp @@ -6,13 +6,13 @@ struct A { ~A(); }; A &&a = dynamic_cast(A{}); -// CHECK: cir.func private @_ZN1AD1Ev(!cir.ptr) extra(#fn_attr) -// CHECK-NEXT: cir.global external @a = #cir.ptr : !cir.ptr {alignment = 8 : i64, ast = #cir.var.decl.ast} +// CHECK: cir.func private @_ZN1AD1Ev(!cir.ptr) extra(#fn_attr) +// CHECK-NEXT: cir.global external @a = #cir.ptr : !cir.ptr {alignment = 8 : i64, ast = #cir.var.decl.ast} // CHECK-NEXT: cir.func internal private @__cxx_global_var_init() { // CHECK-NEXT: cir.scope { -// CHECK-NEXT: %[[SEVEN:[0-9]+]] = cir.get_global @a : !cir.ptr> -// CHECK-NEXT: %[[EIGHT:[0-9]+]] = cir.get_global @_ZGR1a_ : !cir.ptr -// CHECK-NEXT: cir.store %[[EIGHT]], %[[SEVEN]] : !cir.ptr, !cir.ptr> +// CHECK-NEXT: %[[SEVEN:[0-9]+]] = cir.get_global @a : !cir.ptr> +// CHECK-NEXT: %[[EIGHT:[0-9]+]] = cir.get_global @_ZGR1a_ : !cir.ptr +// CHECK-NEXT: cir.store %[[EIGHT]], %[[SEVEN]] : !cir.ptr, !cir.ptr> // CHECK-NEXT: } // CHECK-NEXT: cir.return // CHECK-NEXT: } diff --git a/clang/test/CIR/CodeGen/three-way-comparison.cpp b/clang/test/CIR/CodeGen/three-way-comparison.cpp index 5733db509398..3936fe63cbb0 100644 --- a/clang/test/CIR/CodeGen/three-way-comparison.cpp +++ b/clang/test/CIR/CodeGen/three-way-comparison.cpp @@ -7,8 +7,8 @@ // BEFORE: #cmp3way_info_partial_ltn1eq0gt1unn127 = #cir.cmp3way_info // BEFORE: #cmp3way_info_strong_ltn1eq0gt1 = #cir.cmp3way_info -// BEFORE: !ty_std3A3A__13A3Apartial_ordering = !cir.record y; diff --git a/clang/test/CIR/CodeGen/throw.cpp b/clang/test/CIR/CodeGen/throw.cpp index 88dfe4284295..343eebf4d90b 100644 --- a/clang/test/CIR/CodeGen/throw.cpp +++ b/clang/test/CIR/CodeGen/throw.cpp @@ -42,9 +42,9 @@ void refoo1() { // CIR: %[[V1:.*]] = cir.const #cir.int<1> : !s32i // CIR: cir.store %[[V1]], %[[V0]] : !s32i, !cir.ptr // CIR: cir.scope { -// CIR: %[[V2:.*]] = cir.alloca !ty_S, !cir.ptr, ["s", init] {alignment = 1 : i64} +// CIR: %[[V2:.*]] = cir.alloca !rec_S, !cir.ptr, ["s", init] {alignment = 1 : i64} // CIR: cir.try { -// CIR: cir.call exception @_ZN1SC2Ev(%[[V2]]) : (!cir.ptr) -> () +// CIR: cir.call exception @_ZN1SC2Ev(%[[V2]]) : (!cir.ptr) -> () // CIR: cir.call exception @__cxa_rethrow() : () -> () // CIR: cir.unreachable // CIR: ^bb1: // no predecessors @@ -113,7 +113,7 @@ void refoo2() { // CIR: %[[V1:.*]] = cir.const #cir.int<1> : !s32i // CIR: cir.store %[[V1]], %[[V0]] : !s32i, !cir.ptr // CIR: cir.scope { -// CIR: %[[V2:.*]] = cir.alloca !ty_S, !cir.ptr, ["s", init] {alignment = 1 : i64} +// CIR: %[[V2:.*]] = cir.alloca !rec_S, !cir.ptr, ["s", init] {alignment = 1 : i64} // CIR: cir.try { // CIR: cir.scope { // CIR: %[[V3:.*]] = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} @@ -126,8 +126,8 @@ void refoo2() { // CIR: cir.condition(%[[V7]]) // CIR: } body { // CIR: cir.scope { -// CIR: %[[V5:.*]] = cir.alloca !ty_S, !cir.ptr, ["s", init] {alignment = 1 : i64} -// CIR: cir.call exception @_ZN1SC2Ev(%[[V5]]) : (!cir.ptr) -> () +// CIR: %[[V5:.*]] = cir.alloca !rec_S, !cir.ptr, ["s", init] {alignment = 1 : i64} +// CIR: cir.call exception @_ZN1SC2Ev(%[[V5]]) : (!cir.ptr) -> () // CIR: cir.call exception @__cxa_rethrow() : () -> () // CIR: cir.unreachable // CIR: ^bb1: // no predecessors @@ -141,7 +141,7 @@ void refoo2() { // CIR: cir.yield // CIR: } // CIR: } -// CIR: cir.call exception @_ZN1SC2Ev(%[[V2]]) : (!cir.ptr) -> () +// CIR: cir.call exception @_ZN1SC2Ev(%[[V2]]) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } catch [type #cir.all { // CIR: %[[V3:.*]] = cir.catch_param -> !cir.ptr @@ -218,12 +218,12 @@ void refoo3() { // CIR: %[[V1:.*]] = cir.const #cir.int<1> : !s32i // CIR: cir.store %[[V1]], %[[V0]] : !s32i, !cir.ptr // CIR: cir.scope { -// CIR: %[[V2:.*]] = cir.alloca !ty_S, !cir.ptr, ["s", init] {alignment = 1 : i64} +// CIR: %[[V2:.*]] = cir.alloca !rec_S, !cir.ptr, ["s", init] {alignment = 1 : i64} // CIR: cir.try { // CIR: cir.call exception @__cxa_rethrow() : () -> () // CIR: cir.unreachable // CIR: ^bb1: // no predecessors -// CIR: cir.call exception @_ZN1SC2Ev(%[[V2]]) : (!cir.ptr) -> () +// CIR: cir.call exception @_ZN1SC2Ev(%[[V2]]) : (!cir.ptr) -> () // CIR: cir.yield // CIR: } catch [type #cir.all { // CIR: %[[V3:.*]] = cir.catch_param -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/try-catch-dtors.cpp b/clang/test/CIR/CodeGen/try-catch-dtors.cpp index 36d4430e764c..482d586f0e21 100644 --- a/clang/test/CIR/CodeGen/try-catch-dtors.cpp +++ b/clang/test/CIR/CodeGen/try-catch-dtors.cpp @@ -322,12 +322,12 @@ void bar() { } // CIR-LABEL: @_Z3barv -// CIR: %[[V0:.*]] = cir.alloca !ty_A, !cir.ptr, ["a"] {alignment = 1 : i64} +// CIR: %[[V0:.*]] = cir.alloca !rec_A, !cir.ptr, ["a"] {alignment = 1 : i64} // CIR: %[[V1:.*]] = cir.alloca !s32i, !cir.ptr, ["b", init] {alignment = 4 : i64} // CIR: %[[V2:.*]] = cir.alloca !s32i, !cir.ptr, ["tmp.try.call.res"] {alignment = 4 : i64} // CIR: cir.try synthetic cleanup { // CIR: %[[V4:.*]] = cir.call exception @_Z3foov() : () -> !s32i cleanup { -// CIR: cir.call @_ZN1AD2Ev(%[[V0]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1AD2Ev(%[[V0]]) : (!cir.ptr) -> () extra(#fn_attr) // CIR: cir.yield // CIR: } // CIR: cir.store %[[V4]], %[[V2]] : !s32i, !cir.ptr @@ -337,7 +337,7 @@ void bar() { // CIR: }] // CIR: %[[V3:.*]] = cir.load %[[V2]] : !cir.ptr, !s32i // CIR: cir.store %[[V3]], %[[V1]] : !s32i, !cir.ptr -// CIR: cir.call @_ZN1AD2Ev(%[[V0]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1AD2Ev(%[[V0]]) : (!cir.ptr) -> () extra(#fn_attr) // CIR: cir.return class C { @@ -351,25 +351,25 @@ void d() { a = b; } -// CIR: %[[V0:.*]] = cir.alloca !ty_C, !cir.ptr, ["a"] {alignment = 1 : i64} -// CIR: %[[V1:.*]] = cir.alloca !ty_C, !cir.ptr, ["b"] {alignment = 1 : i64} +// CIR: %[[V0:.*]] = cir.alloca !rec_C, !cir.ptr, ["a"] {alignment = 1 : i64} +// CIR: %[[V1:.*]] = cir.alloca !rec_C, !cir.ptr, ["b"] {alignment = 1 : i64} // CIR: cir.scope { -// CIR: %[[V2:.*]] = cir.alloca !ty_C, !cir.ptr, ["agg.tmp0"] {alignment = 1 : i64} -// CIR: cir.call @_ZN1CC2ERKS_(%[[V2]], %[[V1]]) : (!cir.ptr, !cir.ptr) -> () extra(#fn_attr) -// CIR: %[[V3:.*]] = cir.load %[[V2]] : !cir.ptr, !ty_C +// CIR: %[[V2:.*]] = cir.alloca !rec_C, !cir.ptr, ["agg.tmp0"] {alignment = 1 : i64} +// CIR: cir.call @_ZN1CC2ERKS_(%[[V2]], %[[V1]]) : (!cir.ptr, !cir.ptr) -> () extra(#fn_attr) +// CIR: %[[V3:.*]] = cir.load %[[V2]] : !cir.ptr, !rec_C // CIR: cir.try synthetic cleanup { -// CIR: cir.call exception @_ZN1CaSES_(%[[V0]], %[[V3]]) : (!cir.ptr, !ty_C) -> () cleanup { -// CIR: cir.call @_ZN1CD1Ev(%[[V2]]) : (!cir.ptr) -> () extra(#fn_attr) -// CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call exception @_ZN1CaSES_(%[[V0]], %[[V3]]) : (!cir.ptr, !rec_C) -> () cleanup { +// CIR: cir.call @_ZN1CD1Ev(%[[V2]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr) -> () extra(#fn_attr) // CIR: cir.yield // CIR: } // CIR: cir.yield // CIR: } catch [#cir.unwind { // CIR: cir.resume // CIR: }] -// CIR: cir.call @_ZN1CD1Ev(%[[V2]]) : (!cir.ptr) -> () extra(#fn_attr) -// CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1CD1Ev(%[[V2]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr) -> () extra(#fn_attr) // CIR: } -// CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr) -> () extra(#fn_attr) -// CIR: cir.call @_ZN1CD1Ev(%[[V0]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr) -> () extra(#fn_attr) +// CIR: cir.call @_ZN1CD1Ev(%[[V0]]) : (!cir.ptr) -> () extra(#fn_attr) // CIR: cir.return diff --git a/clang/test/CIR/CodeGen/try-catch.cpp b/clang/test/CIR/CodeGen/try-catch.cpp index 7338c0c94e17..a9e3fb2d14e4 100644 --- a/clang/test/CIR/CodeGen/try-catch.cpp +++ b/clang/test/CIR/CodeGen/try-catch.cpp @@ -121,7 +121,7 @@ void tc5() { } // CHECK: cir.try { -// CHECK: cir.call exception @_ZN1SC2Ev({{.*}}) : (!cir.ptr) -> () +// CHECK: cir.call exception @_ZN1SC2Ev({{.*}}) : (!cir.ptr) -> () // CHECK: cir.yield // CHECK: } catch [type #cir.all { // CHECK: {{.*}} = cir.catch_param -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/typedef.c b/clang/test/CIR/CodeGen/typedef.c index 2f34ff824e1c..24eb8606fad9 100644 --- a/clang/test/CIR/CodeGen/typedef.c +++ b/clang/test/CIR/CodeGen/typedef.c @@ -6,5 +6,5 @@ void local_typedef() { } //CHECK: cir.func no_proto @local_typedef() -//CHECK: {{.*}} = cir.alloca !ty_Struct, !cir.ptr, ["s"] {alignment = 4 : i64} +//CHECK: {{.*}} = cir.alloca !rec_Struct, !cir.ptr, ["s"] {alignment = 4 : i64} //CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/union-array.c b/clang/test/CIR/CodeGen/union-array.c index 3788b6e23741..6b5fcb2c907e 100644 --- a/clang/test/CIR/CodeGen/union-array.c +++ b/clang/test/CIR/CodeGen/union-array.c @@ -35,5 +35,5 @@ void foo() { U arr[2] = {{.b = {1, 2}}, {.a = {1}}}; } void bar(void) { int *x[2] = { &g.f0, &g.f0 }; } -// CIR: cir.global "private" internal dsolocal @g = #cir.const_record<{#cir.int<5> : !s32i}> : !ty_anon_struct +// CIR: cir.global "private" internal dsolocal @g = #cir.const_record<{#cir.int<5> : !s32i}> : !rec_anon_struct // CIR: cir.const #cir.const_array<[#cir.global_view<@g> : !cir.ptr, #cir.global_view<@g> : !cir.ptr]> : !cir.array x 2> diff --git a/clang/test/CIR/CodeGen/union-init.c b/clang/test/CIR/CodeGen/union-init.c index ab2bc6ad8564..28d256af9326 100644 --- a/clang/test/CIR/CodeGen/union-init.c +++ b/clang/test/CIR/CodeGen/union-init.c @@ -20,13 +20,13 @@ void foo(int x) { // CHECK-LABEL: cir.func @foo( // CHECK: %[[VAL_1:.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} -// CHECK: %[[VAL_2:.*]] = cir.alloca !ty_A, !cir.ptr, ["a", init] {alignment = 4 : i64} +// CHECK: %[[VAL_2:.*]] = cir.alloca !rec_A, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK: cir.store {{.*}}, %[[VAL_1]] : !s32i, !cir.ptr -// CHECK: %[[VAL_3:.*]] = cir.get_member %[[VAL_2]][1] {name = ""} : !cir.ptr -> !cir.ptr -// CHECK: %[[VAL_4:.*]] = cir.cast(bitcast, %[[VAL_3]] : !cir.ptr), !cir.ptr +// CHECK: %[[VAL_3:.*]] = cir.get_member %[[VAL_2]][1] {name = ""} : !cir.ptr -> !cir.ptr +// CHECK: %[[VAL_4:.*]] = cir.cast(bitcast, %[[VAL_3]] : !cir.ptr), !cir.ptr // CHECK: %[[VAL_5:.*]] = cir.load %[[VAL_1]] : !cir.ptr, !s32i // CHECK: %[[VAL_6:.*]] = cir.set_bitfield(#[[bfi_x]], %[[VAL_4]] : !cir.ptr, %[[VAL_5]] : !s32i) -> !s32i -// CHECK: %[[VAL_7:.*]] = cir.cast(bitcast, %[[VAL_3]] : !cir.ptr), !cir.ptr +// CHECK: %[[VAL_7:.*]] = cir.cast(bitcast, %[[VAL_3]] : !cir.ptr), !cir.ptr // CHECK: %[[VAL_8:.*]] = cir.const #cir.int<0> : !s32i // CHECK: %[[VAL_9:.*]] = cir.set_bitfield(#[[bfi_y]], %[[VAL_7]] : !cir.ptr, %[[VAL_8]] : !s32i) -> !s32i // CHECK: cir.return @@ -52,9 +52,9 @@ typedef union { } U; // CHECK: %[[VAL_0:.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} -// CHECK: %[[VAL_1:.*]] = cir.alloca !ty_U, !cir.ptr, ["u", init] {alignment = 4 : i64} +// CHECK: %[[VAL_1:.*]] = cir.alloca !rec_U, !cir.ptr, ["u", init] {alignment = 4 : i64} // CHECK: cir.store %arg0, %[[VAL_0]] : !s32i, !cir.ptr -// CHECK: %[[VAL_2:.*]] = cir.cast(bitcast, %[[VAL_1]] : !cir.ptr), !cir.ptr +// CHECK: %[[VAL_2:.*]] = cir.cast(bitcast, %[[VAL_1]] : !cir.ptr), !cir.ptr // CHECK: %[[VAL_3:.*]] = cir.load %[[VAL_0]] : !cir.ptr, !s32i // CHECK: cir.store %[[VAL_3]], %[[VAL_2]] : !s32i, !cir.ptr diff --git a/clang/test/CIR/CodeGen/union-padding.c b/clang/test/CIR/CodeGen/union-padding.c index 8a6ba2c6a716..ba8c56c6c7be 100644 --- a/clang/test/CIR/CodeGen/union-padding.c +++ b/clang/test/CIR/CodeGen/union-padding.c @@ -15,8 +15,8 @@ short use() { U u; return **g3; } -// CHECK: !ty_U = !cir.record}> -// CHECK: !ty_anon_struct = !cir.record}> +// CHECK: !rec_U = !cir.record}> +// CHECK: !rec_anon_struct = !cir.record}> // CHECK: @g3 = #cir.global_view<@g2> : !cir.ptr> // CHECK: @g2 = #cir.const_array<[#cir.global_view<@g1, [1]> : !cir.ptr]> : !cir.array x 1> @@ -24,9 +24,9 @@ short use() { // CHECK: @g1 = // CHECK-SAME: #cir.const_array<[ // CHECK-SAME: #cir.const_record<{#cir.int<-2> : !s16i, -// CHECK-SAME: #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> : !ty_anon_struct, +// CHECK-SAME: #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> : !rec_anon_struct, // CHECK-SAME: #cir.const_record<{#cir.int<-2> : !s16i, -// CHECK-SAME: #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> : !ty_anon_struct -// CHECK-SAME: ]> : !cir.array +// CHECK-SAME: #cir.const_array<[#cir.zero : !u8i, #cir.zero : !u8i]> : !cir.array}> : !rec_anon_struct +// CHECK-SAME: ]> : !cir.array diff --git a/clang/test/CIR/CodeGen/union.cpp b/clang/test/CIR/CodeGen/union.cpp index eeecf07cb506..d33ab93fe13b 100644 --- a/clang/test/CIR/CodeGen/union.cpp +++ b/clang/test/CIR/CodeGen/union.cpp @@ -6,15 +6,15 @@ typedef union { yolo y; struct { int lifecnt; }; } yolm; typedef union { yolo y; struct { int *lifecnt; int genpad; }; } yolm2; typedef union { yolo y; struct { bool life; int genpad; }; } yolm3; -// CHECK-DAG: !ty_U23A3ADummy = !cir.record -// CHECK-DAG: !ty_anon2E0 = !cir.record -// CHECK-DAG: !ty_anon2E2 = !cir.record -// CHECK-DAG: !ty_yolo = !cir.record -// CHECK-DAG: !ty_anon2E1 = !cir.record, !s32i} #cir.record.decl.ast> +// CHECK-DAG: !rec_U23A3ADummy = !cir.record +// CHECK-DAG: !rec_anon2E0 = !cir.record +// CHECK-DAG: !rec_anon2E2 = !cir.record +// CHECK-DAG: !rec_yolo = !cir.record +// CHECK-DAG: !rec_anon2E1 = !cir.record, !s32i} #cir.record.decl.ast> -// CHECK-DAG: !ty_yolm = !cir.record -// CHECK-DAG: !ty_yolm3 = !cir.record -// CHECK-DAG: !ty_yolm2 = !cir.record +// CHECK-DAG: !rec_yolm = !cir.record +// CHECK-DAG: !rec_yolm3 = !cir.record +// CHECK-DAG: !rec_yolm2 = !cir.record // Should generate a union type with all members preserved. union U { @@ -24,7 +24,7 @@ union U { float f; double d; }; -// CHECK-DAG: !ty_U = !cir.record +// CHECK-DAG: !rec_U = !cir.record // Should generate unions with complex members. union U2 { @@ -34,14 +34,14 @@ union U2 { float f; } s; } u2; -// CHECK-DAG: !cir.record +// CHECK-DAG: !cir.record // Should genereate unions without padding. union U3 { short b; U u; } u3; -// CHECK-DAG: !ty_U3 = !cir.record +// CHECK-DAG: !rec_U3 = !cir.record void m() { yolm q; @@ -50,31 +50,31 @@ void m() { } // CHECK: cir.func @_Z1mv() -// CHECK: cir.alloca !ty_yolm, !cir.ptr, ["q"] {alignment = 4 : i64} -// CHECK: cir.alloca !ty_yolm2, !cir.ptr, ["q2"] {alignment = 8 : i64} -// CHECK: cir.alloca !ty_yolm3, !cir.ptr, ["q3"] {alignment = 4 : i64} +// CHECK: cir.alloca !rec_yolm, !cir.ptr, ["q"] {alignment = 4 : i64} +// CHECK: cir.alloca !rec_yolm2, !cir.ptr, ["q2"] {alignment = 8 : i64} +// CHECK: cir.alloca !rec_yolm3, !cir.ptr, ["q3"] {alignment = 4 : i64} void shouldGenerateUnionAccess(union U u) { u.b = true; - // CHECK: %[[#BASE:]] = cir.get_member %0[0] {name = "b"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[0] {name = "b"} : !cir.ptr -> !cir.ptr // CHECK: cir.store %{{.+}}, %[[#BASE]] : !cir.bool, !cir.ptr u.b; - // CHECK: cir.get_member %0[0] {name = "b"} : !cir.ptr -> !cir.ptr + // CHECK: cir.get_member %0[0] {name = "b"} : !cir.ptr -> !cir.ptr u.i = 1; - // CHECK: %[[#BASE:]] = cir.get_member %0[2] {name = "i"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[2] {name = "i"} : !cir.ptr -> !cir.ptr // CHECK: cir.store %{{.+}}, %[[#BASE]] : !s32i, !cir.ptr u.i; - // CHECK: %[[#BASE:]] = cir.get_member %0[2] {name = "i"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[2] {name = "i"} : !cir.ptr -> !cir.ptr u.f = 0.1F; - // CHECK: %[[#BASE:]] = cir.get_member %0[3] {name = "f"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[3] {name = "f"} : !cir.ptr -> !cir.ptr // CHECK: cir.store %{{.+}}, %[[#BASE]] : !cir.float, !cir.ptr u.f; - // CHECK: %[[#BASE:]] = cir.get_member %0[3] {name = "f"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[3] {name = "f"} : !cir.ptr -> !cir.ptr u.d = 0.1; - // CHECK: %[[#BASE:]] = cir.get_member %0[4] {name = "d"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[4] {name = "d"} : !cir.ptr -> !cir.ptr // CHECK: cir.store %{{.+}}, %[[#BASE]] : !cir.double, !cir.ptr u.d; - // CHECK: %[[#BASE:]] = cir.get_member %0[4] {name = "d"} : !cir.ptr -> !cir.ptr + // CHECK: %[[#BASE:]] = cir.get_member %0[4] {name = "d"} : !cir.ptr -> !cir.ptr } typedef union { @@ -84,8 +84,8 @@ typedef union { void noCrushOnDifferentSizes() { A a = {0}; - // CHECK: %[[#TMP0:]] = cir.alloca !ty_A, !cir.ptr, ["a"] {alignment = 4 : i64} - // CHECK: %[[#TMP1:]] = cir.cast(bitcast, %[[#TMP0]] : !cir.ptr), !cir.ptr - // CHECK: %[[#TMP2:]] = cir.const #cir.zero : !ty_anon_struct - // CHECK: cir.store %[[#TMP2]], %[[#TMP1]] : !ty_anon_struct, !cir.ptr + // CHECK: %[[#TMP0:]] = cir.alloca !rec_A, !cir.ptr, ["a"] {alignment = 4 : i64} + // CHECK: %[[#TMP1:]] = cir.cast(bitcast, %[[#TMP0]] : !cir.ptr), !cir.ptr + // CHECK: %[[#TMP2:]] = cir.const #cir.zero : !rec_anon_struct + // CHECK: cir.store %[[#TMP2]], %[[#TMP1]] : !rec_anon_struct, !cir.ptr } diff --git a/clang/test/CIR/CodeGen/var-arg-float.c b/clang/test/CIR/CodeGen/var-arg-float.c index 646e6935d931..42405e3d0891 100644 --- a/clang/test/CIR/CodeGen/var-arg-float.c +++ b/clang/test/CIR/CodeGen/var-arg-float.c @@ -13,26 +13,26 @@ double f1(int n, ...) { return res; } -// BEFORE: !ty___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} +// BEFORE: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} // BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !cir.double // BEFORE: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["__retval"] // BEFORE: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["res", init] -// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr -// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr) -> !cir.double +// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr +// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr) -> !cir.double // BEFORE: cir.store [[TMP0]], [[RESP]] : !cir.double, !cir.ptr -// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr +// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr // BEFORE: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr, !cir.double // BEFORE: cir.store [[RES]], [[RETP]] : !cir.double, !cir.ptr // BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr, !cir.double // BEFORE: cir.return [[RETV]] : !cir.double // beginning block cir code -// AFTER: !ty___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} +// AFTER: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} // AFTER: cir.func @f1(%arg0: !s32i, ...) -> !cir.double // AFTER: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["__retval"] // AFTER: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["res", init] -// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr -// AFTER: [[VR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][4] {name = "vr_offs"} : !cir.ptr -> !cir.ptr +// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr +// AFTER: [[VR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][4] {name = "vr_offs"} : !cir.ptr -> !cir.ptr // AFTER: [[VR_OFFS:%.*]] = cir.load [[VR_OFFS_P]] : !cir.ptr, !s32i // AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i // AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[VR_OFFS]], [[ZERO]]) : !s32i, !cir.bool @@ -47,7 +47,7 @@ double f1(int n, ...) { // AFTER: [[BB_IN_REG]]: -// AFTER-NEXT: [[VR_TOP_P:%.*]] = cir.get_member [[VARLIST]][2] {name = "vr_top"} : !cir.ptr -> !cir.ptr> +// AFTER-NEXT: [[VR_TOP_P:%.*]] = cir.get_member [[VARLIST]][2] {name = "vr_top"} : !cir.ptr -> !cir.ptr> // AFTER-NEXT: [[VR_TOP:%.*]] = cir.load [[VR_TOP_P]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[VR_TOP]] : !cir.ptr), !cir.ptr // AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr, [[VR_OFFS]] : !s32i), !cir.ptr @@ -56,7 +56,7 @@ double f1(int n, ...) { // AFTER: [[BB_ON_STACK]]: -// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr -> !cir.ptr> +// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr -> !cir.ptr> // AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i // AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr), !cir.ptr @@ -69,7 +69,7 @@ double f1(int n, ...) { // AFTER-NEXT: [[TMP0:%.*]] = cir.cast(bitcast, [[BLK_ARG]] : !cir.ptr), !cir.ptr // AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr, !cir.double // AFTER: cir.store [[TMP1]], [[RESP]] : !cir.double, !cir.ptr -// AFTER: cir.va.end [[VARLIST]] : !cir.ptr +// AFTER: cir.va.end [[VARLIST]] : !cir.ptr // AFTER: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr, !cir.double // AFTER: cir.store [[RES]], [[RETP]] : !cir.double, !cir.ptr // AFTER: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr, !cir.double diff --git a/clang/test/CIR/CodeGen/var-arg-scope.c b/clang/test/CIR/CodeGen/var-arg-scope.c index a57fcb9f1944..8f2650634d32 100644 --- a/clang/test/CIR/CodeGen/var-arg-scope.c +++ b/clang/test/CIR/CodeGen/var-arg-scope.c @@ -7,20 +7,20 @@ void f1(__builtin_va_list c) { { __builtin_va_arg(c, void *); } } -// BEFORE: cir.func @f1(%arg0: !ty___va_list) attributes -// BEFORE: [[VAR_LIST:%.*]] = cir.alloca !ty___va_list, !cir.ptr, ["c", init] {alignment = 8 : i64} -// BEFORE: cir.store %arg0, [[VAR_LIST]] : !ty___va_list, !cir.ptr +// BEFORE: cir.func @f1(%arg0: !rec___va_list) attributes +// BEFORE: [[VAR_LIST:%.*]] = cir.alloca !rec___va_list, !cir.ptr, ["c", init] {alignment = 8 : i64} +// BEFORE: cir.store %arg0, [[VAR_LIST]] : !rec___va_list, !cir.ptr // BEFORE: cir.scope { -// BEFORE-NEXT: [[TMP:%.*]] = cir.va.arg [[VAR_LIST]] : (!cir.ptr) -> !cir.ptr +// BEFORE-NEXT: [[TMP:%.*]] = cir.va.arg [[VAR_LIST]] : (!cir.ptr) -> !cir.ptr // BEFORE-NEXT: } // BEFORE-NEXT: cir.return -// AFTER: cir.func @f1(%arg0: !ty___va_list) attributes -// AFTER: [[VARLIST:%.*]] = cir.alloca !ty___va_list, !cir.ptr, ["c", init] {alignment = 8 : i64} -// AFTER: cir.store %arg0, [[VARLIST]] : !ty___va_list, !cir.ptr +// AFTER: cir.func @f1(%arg0: !rec___va_list) attributes +// AFTER: [[VARLIST:%.*]] = cir.alloca !rec___va_list, !cir.ptr, ["c", init] {alignment = 8 : i64} +// AFTER: cir.store %arg0, [[VARLIST]] : !rec___va_list, !cir.ptr // AFTER: cir.scope { // -// AFTER-NEXT: [[GR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][3] {name = "gr_offs"} : !cir.ptr -> !cir.ptr +// AFTER-NEXT: [[GR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][3] {name = "gr_offs"} : !cir.ptr -> !cir.ptr // AFTER-NEXT: [[GR_OFFS:%.*]] = cir.load [[GR_OFFS_P]] : !cir.ptr // AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i // AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[GR_OFFS]], [[ZERO]]) : !s32i, !cir.bool @@ -36,7 +36,7 @@ void f1(__builtin_va_list c) { // arg is passed in register. // AFTER: [[BB_IN_REG]]: -// AFTER-NEXT: [[GR_TOP_P:%.*]] = cir.get_member [[VARLIST]][1] {name = "gr_top"} : !cir.ptr -> !cir.ptr> +// AFTER-NEXT: [[GR_TOP_P:%.*]] = cir.get_member [[VARLIST]][1] {name = "gr_top"} : !cir.ptr -> !cir.ptr> // AFTER-NEXT: [[GR_TOP:%.*]] = cir.load [[GR_TOP_P]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[GR_TOP]] : !cir.ptr), !cir.ptr // AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr, [[GR_OFFS]] : !s32i), !cir.ptr @@ -45,7 +45,7 @@ void f1(__builtin_va_list c) { // arg is passed in stack. // AFTER: [[BB_ON_STACK]]: -// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr -> !cir.ptr> +// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr -> !cir.ptr> // AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i // AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr), !cir.ptr diff --git a/clang/test/CIR/CodeGen/var-arg.c b/clang/test/CIR/CodeGen/var-arg.c index 24e9487b389d..8d4702bc14f3 100644 --- a/clang/test/CIR/CodeGen/var-arg.c +++ b/clang/test/CIR/CodeGen/var-arg.c @@ -13,25 +13,25 @@ int f1(int n, ...) { return res; } -// BEFORE: !ty___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} +// BEFORE: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} // BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !s32i // BEFORE: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // BEFORE: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr, ["res", init] -// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr -// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr) -> !s32i +// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr +// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr) -> !s32i // BEFORE: cir.store [[TMP0]], [[RESP]] : !s32i, !cir.ptr -// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr +// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr // BEFORE: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr, !s32i // BEFORE: cir.store [[RES]], [[RETP]] : !s32i, !cir.ptr // BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr, !s32i // BEFORE: cir.return [[RETV]] : !s32i -// AFTER: !ty___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} +// AFTER: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} // AFTER: cir.func @f1(%arg0: !s32i, ...) -> !s32i // AFTER: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // AFTER: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr, ["res", init] -// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr -// AFTER: [[GR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][3] {name = "gr_offs"} : !cir.ptr -> !cir.ptr +// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr +// AFTER: [[GR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][3] {name = "gr_offs"} : !cir.ptr -> !cir.ptr // AFTER: [[GR_OFFS:%.*]] = cir.load [[GR_OFFS_P]] : !cir.ptr, !s32i // AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i // AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[GR_OFFS]], [[ZERO]]) : !s32i, !cir.bool @@ -47,7 +47,7 @@ int f1(int n, ...) { // arg is passed in register. // AFTER: [[BB_IN_REG]]: -// AFTER-NEXT: [[GR_TOP_P:%.*]] = cir.get_member [[VARLIST]][1] {name = "gr_top"} : !cir.ptr -> !cir.ptr> +// AFTER-NEXT: [[GR_TOP_P:%.*]] = cir.get_member [[VARLIST]][1] {name = "gr_top"} : !cir.ptr -> !cir.ptr> // AFTER-NEXT: [[GR_TOP:%.*]] = cir.load [[GR_TOP_P]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[GR_TOP]] : !cir.ptr), !cir.ptr // AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr, [[GR_OFFS]] : !s32i), !cir.ptr @@ -56,7 +56,7 @@ int f1(int n, ...) { // arg is passed in stack. // AFTER: [[BB_ON_STACK]]: -// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr -> !cir.ptr> +// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr -> !cir.ptr> // AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr>, !cir.ptr // AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i // AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr), !cir.ptr @@ -73,7 +73,7 @@ int f1(int n, ...) { // AFTER-NEXT: [[TMP0:%.*]] = cir.cast(bitcast, [[BLK_ARG]] : !cir.ptr), !cir.ptr // AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr, !s32i // AFTER: cir.store [[TMP1]], [[RESP]] : !s32i, !cir.ptr -// AFTER: cir.va.end [[VARLIST]] : !cir.ptr +// AFTER: cir.va.end [[VARLIST]] : !cir.ptr // AFTER: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr, !s32i // AFTER: cir.store [[RES]], [[RETP]] : !s32i, !cir.ptr // AFTER: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr, !s32i diff --git a/clang/test/CIR/CodeGen/variadic-ctor.cpp b/clang/test/CIR/CodeGen/variadic-ctor.cpp index afc2293a8895..eb5ab5c377a1 100644 --- a/clang/test/CIR/CodeGen/variadic-ctor.cpp +++ b/clang/test/CIR/CodeGen/variadic-ctor.cpp @@ -8,4 +8,4 @@ class A { A a(nullptr, 1, "str"); -// CIR: cir.func private @_ZN1AC1EPvz(!cir.ptr, !cir.ptr, ...) +// CIR: cir.func private @_ZN1AC1EPvz(!cir.ptr, !cir.ptr, ...) diff --git a/clang/test/CIR/CodeGen/vector.cpp b/clang/test/CIR/CodeGen/vector.cpp index 177b4813b226..a3b2e8cdefbf 100644 --- a/clang/test/CIR/CodeGen/vector.cpp +++ b/clang/test/CIR/CodeGen/vector.cpp @@ -12,13 +12,13 @@ namespace std { } // namespace std // CHECK: cir.func linkonce_odr @_ZNSt6vectorIyE6resizeEm( -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !u64i, !cir.ptr, ["__sz", init] {alignment = 8 : i64} // CHECK: %2 = cir.alloca !u64i, !cir.ptr, ["__cs", init] {alignment = 8 : i64} -// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> +// CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK: cir.store %arg1, %1 : !u64i, !cir.ptr -// CHECK: %3 = cir.load %0 : !cir.ptr>, !cir.ptr -// CHECK: %4 = cir.call @_ZNKSt6vectorIyE4sizeEv(%3) : (!cir.ptr) -> !u64i +// CHECK: %3 = cir.load %0 : !cir.ptr>, !cir.ptr +// CHECK: %4 = cir.call @_ZNKSt6vectorIyE4sizeEv(%3) : (!cir.ptr) -> !u64i // CHECK: cir.store %4, %2 : !u64i, !cir.ptr // CHECK: cir.scope { // CHECK: %5 = cir.load %2 : !cir.ptr, !u64i diff --git a/clang/test/CIR/CodeGen/virtual-base-cast.cpp b/clang/test/CIR/CodeGen/virtual-base-cast.cpp index 2c2a3e378714..9d7ed39bc91f 100644 --- a/clang/test/CIR/CodeGen/virtual-base-cast.cpp +++ b/clang/test/CIR/CodeGen/virtual-base-cast.cpp @@ -21,7 +21,7 @@ A* a() { return x; } // CIR: %[[OFFSET_PTR_CAST:.*]] = cir.cast(bitcast, %[[OFFSET_PTR]] : !cir.ptr), !cir.ptr // CIR: %[[OFFSET:.*]] = cir.load %[[OFFSET_PTR_CAST]] : !cir.ptr, !s64i // CIR: %[[VBASE_ADDR:.*]] = cir.ptr_stride({{.*}} : !cir.ptr, %[[OFFSET]] : !s64i), !cir.ptr -// CIR: cir.cast(bitcast, %[[VBASE_ADDR]] : !cir.ptr), !cir.ptr +// CIR: cir.cast(bitcast, %[[VBASE_ADDR]] : !cir.ptr), !cir.ptr // FIXME: this version should include null check. // LLVM-LABEL: @_Z1av() @@ -50,4 +50,4 @@ BB* d() { return y; } // LLVM: %[[OFFSET_PTR:.*]] = load i64, ptr %[[OFFSET_OFFSET]], align 8 // LLVM: %[[ADJUST:.*]] = add i64 %[[OFFSET_PTR]], 16 // LLVM: %[[VBASE_ADDR:.*]] = getelementptr i8, ptr {{.*}}, i64 %[[ADJUST]] -// LLVM: store ptr %[[VBASE_ADDR]], \ No newline at end of file +// LLVM: store ptr %[[VBASE_ADDR]], diff --git a/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp b/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp index 877475b15ebd..5c453b7fd84f 100644 --- a/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp +++ b/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp @@ -32,7 +32,7 @@ struct B : A { // LLVM: call void @_ZN1AD2Ev // Complete dtor: just an alias because there are no virtual bases. -// CIR: cir.func private @_ZN1BD1Ev(!cir.ptr) alias(@_ZN1BD2Ev) +// CIR: cir.func private @_ZN1BD1Ev(!cir.ptr) alias(@_ZN1BD2Ev) // FIXME: LLVM output should be: @_ZN1BD1Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev // LLVM: declare dso_local void @_ZN1BD1Ev(ptr) @@ -42,12 +42,12 @@ struct B : A { // LLVM: call void @_ZdlPv // (aliases from C) -// CIR: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { -// CIR: cir.func private @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) +// CIR: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { +// CIR: cir.func private @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) -// CIR_O1-NOT: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { -// CIR_O1: cir.func private @_ZN1CD2Ev(!cir.ptr) alias(@_ZN1BD2Ev) -// CIR_O1: cir.func private @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) +// CIR_O1-NOT: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { +// CIR_O1: cir.func private @_ZN1CD2Ev(!cir.ptr) alias(@_ZN1BD2Ev) +// CIR_O1: cir.func private @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) // FIXME: LLVM output should be: @_ZN1CD2Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev // LLVM: define dso_local void @_ZN1CD2Ev(ptr diff --git a/clang/test/CIR/CodeGen/vtable-emission.cpp b/clang/test/CIR/CodeGen/vtable-emission.cpp index adba48865895..e83259c38204 100644 --- a/clang/test/CIR/CodeGen/vtable-emission.cpp +++ b/clang/test/CIR/CodeGen/vtable-emission.cpp @@ -12,8 +12,8 @@ struct S { void S::key() {} -// CHECK-DAG: !ty_anon_struct1 = !cir.record x 4>}> -// CHECK-DAG: !ty_anon_struct2 = !cir.record}> +// CHECK-DAG: !rec_anon_struct1 = !cir.record x 4>}> +// CHECK-DAG: !rec_anon_struct2 = !cir.record}> // The definition of the key function should result in the vtable being emitted. // CHECK: cir.global external @_ZTV1S = #cir.vtable @@ -22,7 +22,7 @@ void S::key() {} // CHECK: cir.global external @sobj = #cir.const_record // CHECK-SAME: <{#cir.global_view<@_ZTV1S, [0 : i32, 2 : i32]> : -// CHECK-SAME: !cir.ptr}> : !ty_anon_struct2 {alignment = 8 : i64} +// CHECK-SAME: !cir.ptr}> : !rec_anon_struct2 {alignment = 8 : i64} // LLVM: @sobj = global { ptr } { ptr getelementptr inbounds // LLVM-SAME: ({ [4 x ptr] }, ptr @_ZTV1S, i32 0, i32 0, i32 2) }, align 8 diff --git a/clang/test/CIR/CodeGen/vtable-rtti.cpp b/clang/test/CIR/CodeGen/vtable-rtti.cpp index c7d14a66dea3..a307768f5002 100644 --- a/clang/test/CIR/CodeGen/vtable-rtti.cpp +++ b/clang/test/CIR/CodeGen/vtable-rtti.cpp @@ -20,19 +20,19 @@ class B : public A }; // Type info B. -// CHECK: ![[TypeInfoB:ty_.*]] = !cir.record, !cir.ptr, !cir.ptr}> +// CHECK: ![[TypeInfoB:rec_.*]] = !cir.record, !cir.ptr, !cir.ptr}> // vtable for A type -// CHECK: ![[VTableTypeA:ty_.*]] = !cir.record x 5>}> -// RTTI_DISABLED: ![[VTableTypeA:ty_.*]] = !cir.record x 5>}> +// CHECK: ![[VTableTypeA:rec_.*]] = !cir.record x 5>}> +// RTTI_DISABLED: ![[VTableTypeA:rec_.*]] = !cir.record x 5>}> // Class A -// CHECK: ![[ClassA:ty_.*]] = !cir.record !u32i>>>} #cir.record.decl.ast> -// RTTI_DISABLED: ![[ClassA:ty_.*]] = !cir.record !u32i>>>} #cir.record.decl.ast> +// CHECK: ![[ClassA:rec_.*]] = !cir.record !u32i>>>} #cir.record.decl.ast> +// RTTI_DISABLED: ![[ClassA:rec_.*]] = !cir.record !u32i>>>} #cir.record.decl.ast> // Class B -// CHECK: ![[ClassB:ty_.*]] = !cir.record -// RTTI_DISABLED: ![[ClassB:ty_.*]] = !cir.record +// CHECK: ![[ClassB:rec_.*]] = !cir.record +// RTTI_DISABLED: ![[ClassB:rec_.*]] = !cir.record // B ctor => @B::B() // Calls @A::A() and initialize __vptr with address of B's vtable. @@ -55,7 +55,7 @@ class B : public A // // CHECK: cir.func @_Z3foov() // CHECK: cir.scope { -// CHECK: %0 = cir.alloca !ty_B, !cir.ptr, ["agg.tmp.ensured"] {alignment = 8 : i64} +// CHECK: %0 = cir.alloca !rec_B, !cir.ptr, ["agg.tmp.ensured"] {alignment = 8 : i64} // CHECK: %1 = cir.const #cir.zero : ![[ClassB]] // CHECK: cir.store %1, %0 : ![[ClassB]], !cir.ptr // CHECK: cir.call @_ZN1BC2Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/vtt.cpp b/clang/test/CIR/CodeGen/vtt.cpp index 83234747296e..4e878b720b06 100644 --- a/clang/test/CIR/CodeGen/vtt.cpp +++ b/clang/test/CIR/CodeGen/vtt.cpp @@ -35,37 +35,37 @@ int f() { } // Vtable of Class A -// CIR: cir.global linkonce_odr @_ZTV1A = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1A> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 3>}> : !ty_anon_struct3 {alignment = 8 : i64} +// CIR: cir.global linkonce_odr @_ZTV1A = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1A> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 3>}> : !rec_anon_struct3 {alignment = 8 : i64} // Class A constructor -// CIR: cir.func linkonce_odr @_ZN1AC2Ev(%arg0: !cir.ptr +// CIR: cir.func linkonce_odr @_ZN1AC2Ev(%arg0: !cir.ptr // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV1A, vtable_index = 0, address_point_index = 2) : !cir.ptr !u32i>>> -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: } // Vtable of Class D -// CIR: cir.global linkonce_odr @_ZTV1D = #cir.vtable<{#cir.const_array<[#cir.ptr<40 : i64> : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1B1wEv> : !cir.ptr, #cir.global_view<@_ZN1D1yEv> : !cir.ptr]> : !cir.array x 5>, #cir.const_array<[#cir.ptr<24 : i64> : !cir.ptr, #cir.ptr<-16 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1C1xEv> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr : !cir.ptr, #cir.ptr<-40 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 4>}> : !ty_anon_struct4 {alignment = 8 : i64} +// CIR: cir.global linkonce_odr @_ZTV1D = #cir.vtable<{#cir.const_array<[#cir.ptr<40 : i64> : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1B1wEv> : !cir.ptr, #cir.global_view<@_ZN1D1yEv> : !cir.ptr]> : !cir.array x 5>, #cir.const_array<[#cir.ptr<24 : i64> : !cir.ptr, #cir.ptr<-16 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1C1xEv> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr : !cir.ptr, #cir.ptr<-40 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 4>}> : !rec_anon_struct4 {alignment = 8 : i64} // VTT of class D // CIR: cir.global linkonce_odr @_ZTT1D = #cir.const_array<[#cir.global_view<@_ZTV1D, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D0_1B, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D0_1B, [1 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D16_1C, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D16_1C, [1 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTV1D, [2 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTV1D, [1 : i32, 3 : i32]> : !cir.ptr]> : !cir.array x 7> {alignment = 8 : i64} // Class B constructor -// CIR: cir.func linkonce_odr @_ZN1BC2Ev(%arg0: !cir.ptr +// CIR: cir.func linkonce_odr @_ZN1BC2Ev(%arg0: !cir.ptr // CIR: %{{[0-9]+}} = cir.vtt.address_point %{{[0-9]+}} : !cir.ptr>, offset = 0 -> !cir.ptr> // CIR: %{{[0-9]+}} = cir.load align(8) %{{[0-9]+}} : !cir.ptr>, !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr, !cir.ptr> // CIR: %{{[0-9]+}} = cir.vtt.address_point %{{[0-9]+}} : !cir.ptr>, offset = 1 -> !cir.ptr> // CIR: %{{[0-9]+}} = cir.load align(8) %{{[0-9]+}} : !cir.ptr>, !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> // CIR: %{{[0-9]+}} = cir.load %{{[0-9]+}} : !cir.ptr>, !cir.ptr // CIR: %{{[0-9]+}} = cir.const #cir.int<-24> : !s64i // CIR: %{{[0-9]+}} = cir.ptr_stride(%{{[0-9]+}} : !cir.ptr, %{{[0-9]+}} : !s64i), !cir.ptr // CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr // CIR: %{{[0-9]+}} = cir.load %{{[0-9]+}} : !cir.ptr, !s64i // CIR: %{{[0-9]+}} = cir.ptr_stride(%{{[0-9]+}} : !cir.ptr, %{{[0-9]+}} : !s64i), !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr, !cir.ptr> // CIR: } @@ -81,53 +81,53 @@ int f() { // LLVM: } // Class C constructor -// CIR: cir.func linkonce_odr @_ZN1CC2Ev(%arg0: !cir.ptr +// CIR: cir.func linkonce_odr @_ZN1CC2Ev(%arg0: !cir.ptr // CIR: %{{[0-9]+}} = cir.vtt.address_point %{{[0-9]+}} : !cir.ptr>, offset = 0 -> !cir.ptr> // CIR: %{{[0-9]+}} = cir.load align(8) %{{[0-9]+}} : !cir.ptr>, !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr, !cir.ptr> // CIR: %{{[0-9]+}} = cir.vtt.address_point %{{[0-9]+}} : !cir.ptr>, offset = 1 -> !cir.ptr> // CIR: %{{[0-9]+}} = cir.load align(8) %{{[0-9]+}} : !cir.ptr>, !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> // CIR: %{{[0-9]+}} = cir.load %{{[0-9]+}} : !cir.ptr>, !cir.ptr // CIR: %{{[0-9]+}} = cir.const #cir.int<-24> : !s64i // CIR: %{{[0-9]+}} = cir.ptr_stride(%{{[0-9]+}} : !cir.ptr, %{{[0-9]+}} : !s64i), !cir.ptr // CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr // CIR: %{{[0-9]+}} = cir.load %{{[0-9]+}} : !cir.ptr, !s64i // CIR: %{{[0-9]+}} = cir.ptr_stride(%{{[0-9]+}} : !cir.ptr, %{{[0-9]+}} : !s64i), !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr, !cir.ptr> // CIR: } // Class D constructor -// CIR: cir.func linkonce_odr @_ZN1DC1Ev(%arg0: !cir.ptr -// CIR: %{{[0-9]+}} = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CIR: cir.store %arg0, %{{[0-9]+}} : !cir.ptr, !cir.ptr> -// CIR: %[[D_PTR:.*]] = cir.load %0 : !cir.ptr>, !cir.ptr -// CIR: %[[A_PTR:.*]] = cir.base_class_addr(%[[D_PTR]] : !cir.ptr nonnull) [40] -> !cir.ptr -// CIR: cir.call @_ZN1AC2Ev(%[[A_PTR]]) : (!cir.ptr) -> () - -// CIR: %[[B_PTR:.*]] = cir.base_class_addr(%[[D_PTR]] : !cir.ptr nonnull) [0] -> !cir.ptr +// CIR: cir.func linkonce_odr @_ZN1DC1Ev(%arg0: !cir.ptr +// CIR: %{{[0-9]+}} = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CIR: cir.store %arg0, %{{[0-9]+}} : !cir.ptr, !cir.ptr> +// CIR: %[[D_PTR:.*]] = cir.load %0 : !cir.ptr>, !cir.ptr +// CIR: %[[A_PTR:.*]] = cir.base_class_addr(%[[D_PTR]] : !cir.ptr nonnull) [40] -> !cir.ptr +// CIR: cir.call @_ZN1AC2Ev(%[[A_PTR]]) : (!cir.ptr) -> () + +// CIR: %[[B_PTR:.*]] = cir.base_class_addr(%[[D_PTR]] : !cir.ptr nonnull) [0] -> !cir.ptr // CIR: %[[VTT_D_TO_B:.*]] = cir.vtt.address_point @_ZTT1D, offset = 1 -> !cir.ptr> -// CIR: cir.call @_ZN1BC2Ev(%[[B_PTR]], %[[VTT_D_TO_B]]) : (!cir.ptr, !cir.ptr>) -> () +// CIR: cir.call @_ZN1BC2Ev(%[[B_PTR]], %[[VTT_D_TO_B]]) : (!cir.ptr, !cir.ptr>) -> () -// CIR: %[[C_PTR:.*]] = cir.base_class_addr(%1 : !cir.ptr nonnull) [16] -> !cir.ptr +// CIR: %[[C_PTR:.*]] = cir.base_class_addr(%1 : !cir.ptr nonnull) [16] -> !cir.ptr // CIR: %[[VTT_D_TO_C:.*]] = cir.vtt.address_point @_ZTT1D, offset = 3 -> !cir.ptr> -// CIR: cir.call @_ZN1CC2Ev(%[[C_PTR]], %[[VTT_D_TO_C]]) : (!cir.ptr, !cir.ptr>) -> () +// CIR: cir.call @_ZN1CC2Ev(%[[C_PTR]], %[[VTT_D_TO_C]]) : (!cir.ptr, !cir.ptr>) -> () // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV1D, vtable_index = 0, address_point_index = 3) : !cir.ptr !u32i>>> -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV1D, vtable_index = 2, address_point_index = 3) : !cir.ptr !u32i>>> -// CIR: %{{[0-9]+}} = cir.base_class_addr(%{{[0-9]+}} : !cir.ptr nonnull) [40] -> !cir.ptr -// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> +// CIR: %{{[0-9]+}} = cir.base_class_addr(%{{[0-9]+}} : !cir.ptr nonnull) [40] -> !cir.ptr +// CIR: %{{[0-9]+}} = cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: %{{[0-9]+}} = cir.vtable.address_point(@_ZTV1D, vtable_index = 1, address_point_index = 3) : !cir.ptr !u32i>>> -// CIR: cir.base_class_addr(%{{[0-9]+}} : !cir.ptr nonnull) [16] -> !cir.ptr -// CIR: cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> +// CIR: cir.base_class_addr(%{{[0-9]+}} : !cir.ptr nonnull) [16] -> !cir.ptr +// CIR: cir.cast(bitcast, %{{[0-9]+}} : !cir.ptr), !cir.ptr !u32i>>>> // CIR: cir.store %{{[0-9]+}}, %{{[0-9]+}} : !cir.ptr !u32i>>>, !cir.ptr !u32i>>>> // CIR: cir.return // CIR: } @@ -166,13 +166,13 @@ namespace other { } // CIR-LABEL: cir.func @_ZN5other1BD1Ev( -// CIR-SAME: %[[VAL_0:.*]]: !cir.ptr -// CIR: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} -// CIR: cir.store %[[VAL_0]], %[[VAL_1]] : !cir.ptr, !cir.ptr> -// CIR: %[[VAL_2:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr +// CIR-SAME: %[[VAL_0:.*]]: !cir.ptr +// CIR: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} +// CIR: cir.store %[[VAL_0]], %[[VAL_1]] : !cir.ptr, !cir.ptr> +// CIR: %[[VAL_2:.*]] = cir.load %[[VAL_1]] : !cir.ptr>, !cir.ptr // CIR: %[[VAL_3:.*]] = cir.vtt.address_point @_ZTTN5other1BE, offset = 0 -> !cir.ptr> -// CIR: cir.call @_ZN5other1BD2Ev(%[[VAL_2]], %[[VAL_3]]) : (!cir.ptr, !cir.ptr>) -> () -// CIR: %[[VAL_4:.*]] = cir.base_class_addr(%[[VAL_2]] : !cir.ptr nonnull) [0] -> !cir.ptr -// CIR: cir.call @_ZN5other1AD2Ev(%[[VAL_4]]) : (!cir.ptr) -> () +// CIR: cir.call @_ZN5other1BD2Ev(%[[VAL_2]], %[[VAL_3]]) : (!cir.ptr, !cir.ptr>) -> () +// CIR: %[[VAL_4:.*]] = cir.base_class_addr(%[[VAL_2]] : !cir.ptr nonnull) [0] -> !cir.ptr +// CIR: cir.call @_ZN5other1AD2Ev(%[[VAL_4]]) : (!cir.ptr) -> () // CIR: cir.return // CIR: } diff --git a/clang/test/CIR/IR/aliases.cir b/clang/test/CIR/IR/aliases.cir index 4916209bcfd2..a330f315d404 100644 --- a/clang/test/CIR/IR/aliases.cir +++ b/clang/test/CIR/IR/aliases.cir @@ -4,11 +4,11 @@ module { // CHECK: @testAnonRecordsAlias cir.func @testAnonRecordsAlias() { - // CHECK: cir.alloca !ty_anon_struct, !cir.ptr + // CHECK: cir.alloca !rec_anon_struct, !cir.ptr %0 = cir.alloca !cir.record}>, !cir.ptr}>>, ["A"] - // CHECK: cir.alloca !ty_anon_struct1, !cir.ptr + // CHECK: cir.alloca !rec_anon_struct1, !cir.ptr %1 = cir.alloca !cir.record}>, !cir.ptr}>>, ["B"] - // CHECK: cir.alloca !ty_anon_union, !cir.ptr + // CHECK: cir.alloca !rec_anon_union, !cir.ptr %2 = cir.alloca !cir.record}>, !cir.ptr}>>, ["C"] cir.return } diff --git a/clang/test/CIR/IR/data-member-ptr.cir b/clang/test/CIR/IR/data-member-ptr.cir index 32f56aa09dd0..103c94ef7b7b 100644 --- a/clang/test/CIR/IR/data-member-ptr.cir +++ b/clang/test/CIR/IR/data-member-ptr.cir @@ -1,17 +1,17 @@ // RUN: cir-opt %s | cir-opt | FileCheck %s !s32i = !cir.int -!ty_Foo = !cir.record +!rec_Foo = !cir.record module { cir.func @null_member() { - %0 = cir.const #cir.data_member : !cir.data_member + %0 = cir.const #cir.data_member : !cir.data_member cir.return } - cir.func @get_runtime_member(%arg0: !cir.ptr) { - %0 = cir.const #cir.data_member<0> : !cir.data_member - %1 = cir.get_runtime_member %arg0[%0 : !cir.data_member] : !cir.ptr -> !cir.ptr + cir.func @get_runtime_member(%arg0: !cir.ptr) { + %0 = cir.const #cir.data_member<0> : !cir.data_member + %1 = cir.get_runtime_member %arg0[%0 : !cir.data_member] : !cir.ptr -> !cir.ptr cir.return } } @@ -19,13 +19,13 @@ module { // CHECK: module { // CHECK-NEXT: cir.func @null_member() { -// CHECK-NEXT: %0 = cir.const #cir.data_member : !cir.data_member +// CHECK-NEXT: %0 = cir.const #cir.data_member : !cir.data_member // CHECK-NEXT: cir.return // CHECK-NEXT: } -// CHECK-NEXT: cir.func @get_runtime_member(%arg0: !cir.ptr) { -// CHECK-NEXT: %0 = cir.const #cir.data_member<0> : !cir.data_member -// CHECK-NEXT: %1 = cir.get_runtime_member %arg0[%0 : !cir.data_member] : !cir.ptr -> !cir.ptr +// CHECK-NEXT: cir.func @get_runtime_member(%arg0: !cir.ptr) { +// CHECK-NEXT: %0 = cir.const #cir.data_member<0> : !cir.data_member +// CHECK-NEXT: %1 = cir.get_runtime_member %arg0[%0 : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK-NEXT: cir.return // CHECK-NEXT: } diff --git a/clang/test/CIR/IR/getmember.cir b/clang/test/CIR/IR/getmember.cir index 9048c23423d5..b46d03f10da0 100644 --- a/clang/test/CIR/IR/getmember.cir +++ b/clang/test/CIR/IR/getmember.cir @@ -4,12 +4,12 @@ !u16i = !cir.int !u32i = !cir.int -!ty_Struct = !cir.record +!rec_Struct = !cir.record module { - cir.func @shouldGetStructMember(%arg0 : !cir.ptr) { - // CHECK: cir.get_member %arg0[1] {name = "test"} : !cir.ptr -> !cir.ptr - %0 = cir.get_member %arg0[1] {name = "test"} : !cir.ptr -> !cir.ptr + cir.func @shouldGetStructMember(%arg0 : !cir.ptr) { + // CHECK: cir.get_member %arg0[1] {name = "test"} : !cir.ptr -> !cir.ptr + %0 = cir.get_member %arg0[1] {name = "test"} : !cir.ptr -> !cir.ptr cir.return } } diff --git a/clang/test/CIR/IR/global.cir b/clang/test/CIR/IR/global.cir index 0ab07e94383b..4c21d060e6e2 100644 --- a/clang/test/CIR/IR/global.cir +++ b/clang/test/CIR/IR/global.cir @@ -3,7 +3,7 @@ !s8i = !cir.int !s32i = !cir.int !s64i = !cir.int -!ty_Init = !cir.record +!rec_Init = !cir.record module { cir.global external @a = #cir.int<3> : !s32i cir.global external @rgb = #cir.const_array<[#cir.int<0> : !s8i, #cir.int<-23> : !s8i, #cir.int<33> : !s8i] : !cir.array> @@ -32,15 +32,15 @@ module { #cir.global_view<@type_info_name_B> : !cir.ptr, #cir.global_view<@type_info_A> : !cir.ptr}> : !cir.record, !cir.ptr, !cir.ptr}> - cir.func private @_ZN4InitC1Eb(!cir.ptr, !s8i) - cir.func private @_ZN4InitD1Ev(!cir.ptr) - cir.global "private" internal @_ZL8__ioinit = ctor : !ty_Init { - %0 = cir.get_global @_ZL8__ioinit : !cir.ptr + cir.func private @_ZN4InitC1Eb(!cir.ptr, !s8i) + cir.func private @_ZN4InitD1Ev(!cir.ptr) + cir.global "private" internal @_ZL8__ioinit = ctor : !rec_Init { + %0 = cir.get_global @_ZL8__ioinit : !cir.ptr %1 = cir.const #cir.int<3> : !s8i - cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !s8i) -> () + cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !s8i) -> () } dtor { - %0 = cir.get_global @_ZL8__ioinit : !cir.ptr - cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () + %0 = cir.get_global @_ZL8__ioinit : !cir.ptr + cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () } cir.func @f31() global_ctor { @@ -87,10 +87,10 @@ module { // CHECK: cir.func @use_global() // CHECK-NEXT: %0 = cir.get_global @a : !cir.ptr -// CHECK: cir.global "private" internal @_ZL8__ioinit = ctor : !ty_Init { -// CHECK-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr +// CHECK: cir.global "private" internal @_ZL8__ioinit = ctor : !rec_Init { +// CHECK-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr // CHECK-NEXT: %1 = cir.const #cir.int<3> : !s8i -// CHECK-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !s8i) -> () +// CHECK-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !s8i) -> () // CHECK-NEXT: } // CHECK: cir.func @f31() global_ctor diff --git a/clang/test/CIR/IR/invalid.cir b/clang/test/CIR/IR/invalid.cir index 709022fa6486..2fc0ef67ff32 100644 --- a/clang/test/CIR/IR/invalid.cir +++ b/clang/test/CIR/IR/invalid.cir @@ -755,9 +755,9 @@ module { // ----- !s8i = !cir.int -!ty_Init = !cir.record +!rec_Init = !cir.record module { - cir.global "private" internal @_ZL8__ioinit = ctor : !ty_Init { + cir.global "private" internal @_ZL8__ioinit = ctor : !rec_Init { } // expected-error@+1 {{custom op 'cir.global' ctor region must have exactly one block}} } @@ -765,12 +765,12 @@ module { // ----- !s8i = !cir.int #true = #cir.bool : !cir.bool -!ty_Init = !cir.record +!rec_Init = !cir.record module { - cir.func private @_ZN4InitC1Eb(!cir.ptr) - cir.global "private" internal @_ZL8__ioinit = ctor : !ty_Init { - %0 = cir.get_global @_ZL8__ioinit : !cir.ptr - cir.call @_ZN4InitC1Eb(%0) : (!cir.ptr) -> () + cir.func private @_ZN4InitC1Eb(!cir.ptr) + cir.global "private" internal @_ZL8__ioinit = ctor : !rec_Init { + %0 = cir.get_global @_ZL8__ioinit : !cir.ptr + cir.call @_ZN4InitC1Eb(%0) : (!cir.ptr) -> () } dtor {} // expected-error@+1 {{custom op 'cir.global' dtor region must have exactly one block}} } diff --git a/clang/test/CIR/IR/struct.cir b/clang/test/CIR/IR/struct.cir index 067579170dba..5212bc6f1379 100644 --- a/clang/test/CIR/IR/struct.cir +++ b/clang/test/CIR/IR/struct.cir @@ -6,20 +6,20 @@ !s32i = !cir.int !u32i = !cir.int -!ty_2222 = !cir.record x 5>}> -!ty_22221 = !cir.record, !cir.ptr, !cir.ptr}> -!ty_A = !cir.record -!ty_i = !cir.record -!ty_S = !cir.record -!ty_S1 = !cir.record +!rec_2222 = !cir.record x 5>}> +!rec_22221 = !cir.record, !cir.ptr, !cir.ptr}> +!rec_A = !cir.record +!rec_i = !cir.record +!rec_S = !cir.record +!rec_S1 = !cir.record // Test recursive struct parsing/printing. -!ty_Node = !cir.record>} #cir.record.decl.ast> +!rec_Node = !cir.record>} #cir.record.decl.ast> // CHECK-DAG: !cir.record>} #cir.record.decl.ast> module { // Dummy function to use types and force them to be printed. - cir.func @useTypes(%arg0: !ty_Node) { + cir.func @useTypes(%arg0: !rec_Node) { cir.return } @@ -30,12 +30,12 @@ module { } // CHECK: cir.func @structs() { -// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] -// CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["i", init] +// CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] +// CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["i", init] cir.func @shouldSuccessfullyParseConstStructAttrs() { - %0 = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i}> : !ty_S1 - // CHECK: cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i}> : !ty_S1 + %0 = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i}> : !rec_S1 + // CHECK: cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i}> : !rec_S1 cir.return } } diff --git a/clang/test/CIR/IR/vtableAttr.cir b/clang/test/CIR/IR/vtableAttr.cir index d02c33125857..db6e37da137e 100644 --- a/clang/test/CIR/IR/vtableAttr.cir +++ b/clang/test/CIR/IR/vtableAttr.cir @@ -4,5 +4,5 @@ module { // Should parse VTable attribute. cir.global external @testVTable = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr]> : !cir.array x 1>}> : !cir.record x 1>}> - // CHECK: cir.global external @testVTable = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr]> : !cir.array x 1>}> : !ty_anon_struct + // CHECK: cir.global external @testVTable = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr]> : !cir.array x 1>}> : !rec_anon_struct } diff --git a/clang/test/CIR/Lowering/ThroughMLIR/vtable.cir b/clang/test/CIR/Lowering/ThroughMLIR/vtable.cir index 4c827d143b87..85f4a26642f5 100644 --- a/clang/test/CIR/Lowering/ThroughMLIR/vtable.cir +++ b/clang/test/CIR/Lowering/ThroughMLIR/vtable.cir @@ -8,39 +8,39 @@ !u8i = !cir.int !void = !cir.void -!ty_anon_struct = !cir.record>, !cir.ptr>}> -!ty_anon_struct1 = !cir.record>, !cir.ptr>, !cir.int, !cir.int, !cir.ptr>, !cir.int, !cir.ptr>, !cir.int}> -!ty_anon_struct2 = !cir.record> x 4>}> -!ty_anon_struct3 = !cir.record> x 3>}> -!ty_anon_struct4 = !cir.record> x 4>, !cir.array> x 3>}> -!ty_Father = !cir.record !cir.int>>>} #cir.record.decl.ast> -!ty_Mother = !cir.record !cir.int>>>} #cir.record.decl.ast> -!ty_Child = !cir.record !cir.int>>>} #cir.record.decl.ast>, !cir.record !cir.int>>>} #cir.record.decl.ast>} #cir.record.decl.ast> +!rec_anon_struct = !cir.record>, !cir.ptr>}> +!rec_anon_struct1 = !cir.record>, !cir.ptr>, !cir.int, !cir.int, !cir.ptr>, !cir.int, !cir.ptr>, !cir.int}> +!rec_anon_struct2 = !cir.record> x 4>}> +!rec_anon_struct3 = !cir.record> x 3>}> +!rec_anon_struct4 = !cir.record> x 4>, !cir.array> x 3>}> +!rec_Father = !cir.record !cir.int>>>} #cir.record.decl.ast> +!rec_Mother = !cir.record !cir.int>>>} #cir.record.decl.ast> +!rec_Child = !cir.record !cir.int>>>} #cir.record.decl.ast>, !cir.record !cir.int>>>} #cir.record.decl.ast>} #cir.record.decl.ast> module { - cir.func linkonce_odr @_ZN6Mother6simpleEv(%arg0: !cir.ptr) { - %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} - cir.store %arg0, %0 : !cir.ptr, !cir.ptr> - %1 = cir.load %0 : !cir.ptr>, !cir.ptr + cir.func linkonce_odr @_ZN6Mother6simpleEv(%arg0: !cir.ptr) { + %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} + cir.store %arg0, %0 : !cir.ptr, !cir.ptr> + %1 = cir.load %0 : !cir.ptr>, !cir.ptr cir.return } - cir.func private @_ZN5ChildC2Ev(%arg0: !cir.ptr) { cir.return } - cir.global linkonce_odr @_ZTV6Mother = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Mother> : !cir.ptr, #cir.global_view<@_ZN6Mother9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>}> : !ty_anon_struct2 {alignment = 8 : i64} + cir.func private @_ZN5ChildC2Ev(%arg0: !cir.ptr) { cir.return } + cir.global linkonce_odr @_ZTV6Mother = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Mother> : !cir.ptr, #cir.global_view<@_ZN6Mother9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>}> : !rec_anon_struct2 {alignment = 8 : i64} cir.global "private" external @_ZTVN10__cxxabiv117__class_type_infoE : !cir.ptr> cir.global linkonce_odr @_ZTS6Mother = #cir.const_array<"6Mother" : !cir.array> : !cir.array {alignment = 1 : i64} - cir.global constant external @_ZTI6Mother = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS6Mother> : !cir.ptr}> : !ty_anon_struct {alignment = 8 : i64} - cir.func linkonce_odr @_ZN6Mother9MotherFooEv(%arg0: !cir.ptr ) { cir.return } - cir.func linkonce_odr @_ZN6Mother10MotherFoo2Ev(%arg0: !cir.ptr ) { cir.return } - cir.global linkonce_odr @_ZTV6Father = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Father> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : !ty_anon_struct3 {alignment = 8 : i64} - cir.func linkonce_odr @_ZN6FatherC2Ev(%arg0: !cir.ptr ) { cir.return } - cir.global linkonce_odr @_ZTV5Child = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN5Child9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr<-8 : i64> : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : !ty_anon_struct4 {alignment = 8 : i64} + cir.global constant external @_ZTI6Mother = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS6Mother> : !cir.ptr}> : !rec_anon_struct {alignment = 8 : i64} + cir.func linkonce_odr @_ZN6Mother9MotherFooEv(%arg0: !cir.ptr ) { cir.return } + cir.func linkonce_odr @_ZN6Mother10MotherFoo2Ev(%arg0: !cir.ptr ) { cir.return } + cir.global linkonce_odr @_ZTV6Father = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Father> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : !rec_anon_struct3 {alignment = 8 : i64} + cir.func linkonce_odr @_ZN6FatherC2Ev(%arg0: !cir.ptr ) { cir.return } + cir.global linkonce_odr @_ZTV5Child = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN5Child9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr<-8 : i64> : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : !rec_anon_struct4 {alignment = 8 : i64} cir.global "private" external @_ZTVN10__cxxabiv121__vmi_class_type_infoE : !cir.ptr> cir.global linkonce_odr @_ZTS5Child = #cir.const_array<"5Child" : !cir.array> : !cir.array {alignment = 1 : i64} cir.global linkonce_odr @_ZTS6Father = #cir.const_array<"6Father" : !cir.array> : !cir.array {alignment = 1 : i64} - cir.global constant external @_ZTI6Father = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS6Father> : !cir.ptr}> : !ty_anon_struct {alignment = 8 : i64} - cir.global constant external @_ZTI5Child = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv121__vmi_class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS5Child> : !cir.ptr, #cir.int<0> : !u32i, #cir.int<2> : !u32i, #cir.global_view<@_ZTI6Mother> : !cir.ptr, #cir.int<2> : !s64i, #cir.global_view<@_ZTI6Father> : !cir.ptr, #cir.int<2050> : !s64i}> : !ty_anon_struct1 {alignment = 8 : i64} - cir.func linkonce_odr @_ZN5Child9MotherFooEv(%arg0: !cir.ptr ) { cir.return } - cir.func linkonce_odr @_ZN6Father9FatherFooEv(%arg0: !cir.ptr ) { cir.return } + cir.global constant external @_ZTI6Father = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS6Father> : !cir.ptr}> : !rec_anon_struct {alignment = 8 : i64} + cir.global constant external @_ZTI5Child = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv121__vmi_class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS5Child> : !cir.ptr, #cir.int<0> : !u32i, #cir.int<2> : !u32i, #cir.global_view<@_ZTI6Mother> : !cir.ptr, #cir.int<2> : !s64i, #cir.global_view<@_ZTI6Father> : !cir.ptr, #cir.int<2050> : !s64i}> : !rec_anon_struct1 {alignment = 8 : i64} + cir.func linkonce_odr @_ZN5Child9MotherFooEv(%arg0: !cir.ptr ) { cir.return } + cir.func linkonce_odr @_ZN6Father9FatherFooEv(%arg0: !cir.ptr ) { cir.return } } // MLIR: llvm.mlir.global linkonce_odr @_ZTV5Child() {addr_space = 0 : i32, alignment = 8 : i64} : !llvm.struct<(array<4 x ptr>, array<3 x ptr>)> { diff --git a/clang/test/CIR/Lowering/array.cir b/clang/test/CIR/Lowering/array.cir index c8fcb7bd156a..b6c6938ad415 100644 --- a/clang/test/CIR/Lowering/array.cir +++ b/clang/test/CIR/Lowering/array.cir @@ -2,7 +2,7 @@ // RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM !s32i = !cir.int -!ty_S = !cir.record +!rec_S = !cir.record module { cir.func @foo() { @@ -21,7 +21,7 @@ module { // LLVM: %1 = alloca [10 x i32], i64 1, align 16 // LLVM-NEXT: ret void - cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S, #cir.zero : !ty_S]> : !cir.array + cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S, #cir.zero : !rec_S]> : !cir.array // CHECK: llvm.mlir.global external @arr() {addr_space = 0 : i32} : !llvm.array<2 x struct<"struct.S", (i32)>> { // CHECK: %0 = llvm.mlir.undef : !llvm.array<2 x struct<"struct.S", (i32)>> // CHECK: %1 = llvm.mlir.undef : !llvm.struct<"struct.S", (i32)> diff --git a/clang/test/CIR/Lowering/class.cir b/clang/test/CIR/Lowering/class.cir index 609166c00b88..ee136ccc8daf 100644 --- a/clang/test/CIR/Lowering/class.cir +++ b/clang/test/CIR/Lowering/class.cir @@ -4,28 +4,28 @@ !s32i = !cir.int !u8i = !cir.int !u32i = !cir.int -!ty_S = !cir.record -!ty_S2A = !cir.record -!ty_S1_ = !cir.record} #cir.record.decl.ast> -!ty_S2_ = !cir.record -!ty_S3_ = !cir.record +!rec_S = !cir.record +!rec_S2A = !cir.record +!rec_S1_ = !cir.record} #cir.record.decl.ast> +!rec_S2_ = !cir.record +!rec_S3_ = !cir.record module { cir.func @test() { - %1 = cir.alloca !ty_S, !cir.ptr, ["x"] {alignment = 4 : i64} + %1 = cir.alloca !rec_S, !cir.ptr, ["x"] {alignment = 4 : i64} // CHECK: %[[#ARRSIZE:]] = llvm.mlir.constant(1 : index) : i64 // CHECK: %[[#CLASS:]] = llvm.alloca %[[#ARRSIZE]] x !llvm.struct<"class.S", (i8, i32)> - %3 = cir.get_member %1[0] {name = "c"} : !cir.ptr -> !cir.ptr + %3 = cir.get_member %1[0] {name = "c"} : !cir.ptr -> !cir.ptr // CHECK: = llvm.getelementptr %[[#CLASS]][0, 0] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"class.S", (i8, i32)> - %5 = cir.get_member %1[1] {name = "i"} : !cir.ptr -> !cir.ptr + %5 = cir.get_member %1[1] {name = "i"} : !cir.ptr -> !cir.ptr // CHECK: = llvm.getelementptr %[[#CLASS]][0, 1] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"class.S", (i8, i32)> cir.return } cir.func @shouldConstInitLocalClassesWithConstStructAttr() { - %0 = cir.alloca !ty_S2A, !cir.ptr, ["s"] {alignment = 4 : i64} - %1 = cir.const #cir.const_record<{#cir.int<1> : !s32i}> : !ty_S2A - cir.store %1, %0 : !ty_S2A, !cir.ptr + %0 = cir.alloca !rec_S2A, !cir.ptr, ["s"] {alignment = 4 : i64} + %1 = cir.const #cir.const_record<{#cir.int<1> : !s32i}> : !rec_S2A + cir.store %1, %0 : !rec_S2A, !cir.ptr cir.return } // CHECK: llvm.func @shouldConstInitLocalClassesWithConstStructAttr() @@ -39,7 +39,7 @@ module { // CHECK: } // Should lower basic #cir.const_record initializer. - cir.global external @s1 = #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<1.000000e-01> : !cir.float, #cir.ptr : !cir.ptr}> : !ty_S1_ + cir.global external @s1 = #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<1.000000e-01> : !cir.float, #cir.ptr : !cir.ptr}> : !rec_S1_ // CHECK: llvm.mlir.global external @s1() {addr_space = 0 : i32} : !llvm.struct<"class.S1", (i32, f32, ptr)> { // CHECK: %0 = llvm.mlir.undef : !llvm.struct<"class.S1", (i32, f32, ptr)> // CHECK: %1 = llvm.mlir.constant(1 : i32) : i32 @@ -52,7 +52,7 @@ module { // CHECK: } // Should lower nested #cir.const_record initializer. - cir.global external @s2 = #cir.const_record<{#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S2A}> : !ty_S2_ + cir.global external @s2 = #cir.const_record<{#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S2A}> : !rec_S2_ // CHECK: llvm.mlir.global external @s2() {addr_space = 0 : i32} : !llvm.struct<"class.S2", (struct<"class.S2A", (i32)>)> { // CHECK: %0 = llvm.mlir.undef : !llvm.struct<"class.S2", (struct<"class.S2A", (i32)>)> // CHECK: %1 = llvm.mlir.undef : !llvm.struct<"class.S2A", (i32)> @@ -62,7 +62,7 @@ module { // CHECK: llvm.return %4 : !llvm.struct<"class.S2", (struct<"class.S2A", (i32)>)> // CHECK: } - cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S3_, #cir.const_record<{#cir.int<2> : !s32i}> : !ty_S3_, #cir.const_record<{#cir.int<3> : !s32i}> : !ty_S3_]> : !cir.array + cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S3_, #cir.const_record<{#cir.int<2> : !s32i}> : !rec_S3_, #cir.const_record<{#cir.int<3> : !s32i}> : !rec_S3_]> : !cir.array // CHECK: llvm.mlir.global external @s3() {addr_space = 0 : i32} : !llvm.array<3 x struct<"class.S3", (i32)>> { // CHECK: %0 = llvm.mlir.undef : !llvm.array<3 x struct<"class.S3", (i32)>> // CHECK: %1 = llvm.mlir.undef : !llvm.struct<"class.S3", (i32)> @@ -82,13 +82,13 @@ module { cir.func @shouldLowerClassCopies() { // CHECK: llvm.func @shouldLowerClassCopies() - %1 = cir.alloca !ty_S, !cir.ptr, ["a"] {alignment = 4 : i64} + %1 = cir.alloca !rec_S, !cir.ptr, ["a"] {alignment = 4 : i64} // CHECK: %[[#ONE:]] = llvm.mlir.constant(1 : index) : i64 // CHECK: %[[#SA:]] = llvm.alloca %[[#ONE]] x !llvm.struct<"class.S", (i8, i32)> {alignment = 4 : i64} : (i64) -> !llvm.ptr - %2 = cir.alloca !ty_S, !cir.ptr, ["b", init] {alignment = 4 : i64} + %2 = cir.alloca !rec_S, !cir.ptr, ["b", init] {alignment = 4 : i64} // CHECK: %[[#ONE:]] = llvm.mlir.constant(1 : index) : i64 // CHECK: %[[#SB:]] = llvm.alloca %[[#ONE]] x !llvm.struct<"class.S", (i8, i32)> {alignment = 4 : i64} : (i64) -> !llvm.ptr - cir.copy %1 to %2 : !cir.ptr + cir.copy %1 to %2 : !cir.ptr // CHECK: %[[#SIZE:]] = llvm.mlir.constant(8 : i32) : i32 // CHECK: "llvm.intr.memcpy"(%[[#SB]], %[[#SA]], %[[#SIZE]]) <{isVolatile = false}> : (!llvm.ptr, !llvm.ptr, i32) -> () cir.return diff --git a/clang/test/CIR/Lowering/const.cir b/clang/test/CIR/Lowering/const.cir index 9de178c33c0d..0fcad3ef400e 100644 --- a/clang/test/CIR/Lowering/const.cir +++ b/clang/test/CIR/Lowering/const.cir @@ -4,7 +4,7 @@ !s8i = !cir.int !s32i = !cir.int !s64i = !cir.int -!ty_anon2E1_ = !cir.record, !cir.int} #cir.record.decl.ast> +!rec_anon2E1_ = !cir.record, !cir.int} #cir.record.decl.ast> module { cir.func @testConstArrInit() { %0 = cir.const #cir.const_array<"string\00" : !cir.array> : !cir.array @@ -40,9 +40,9 @@ module { // CHECK: llvm.return cir.func @testConstArrayOfStructs() { - %0 = cir.alloca !cir.array, !cir.ptr>, ["a"] {alignment = 4 : i64} - %1 = cir.const #cir.const_array<[#cir.const_record<{#cir.int<0> : !s32i, #cir.int<1> : !s32i}> : !ty_anon2E1_]> : !cir.array - cir.store %1, %0 : !cir.array, !cir.ptr> + %0 = cir.alloca !cir.array, !cir.ptr>, ["a"] {alignment = 4 : i64} + %1 = cir.const #cir.const_array<[#cir.const_record<{#cir.int<0> : !s32i, #cir.int<1> : !s32i}> : !rec_anon2E1_]> : !cir.array + cir.store %1, %0 : !cir.array, !cir.ptr> cir.return } // CHECK: llvm.func @testConstArrayOfStructs() diff --git a/clang/test/CIR/Lowering/globals.cir b/clang/test/CIR/Lowering/globals.cir index 0f25312827a7..b9142c7babe0 100644 --- a/clang/test/CIR/Lowering/globals.cir +++ b/clang/test/CIR/Lowering/globals.cir @@ -11,11 +11,11 @@ !u32i = !cir.int !u64i = !cir.int !u8i = !cir.int -!ty_A = !cir.record x 2>} #cir.record.decl.ast> -!ty_Bar = !cir.record -!ty_StringStruct = !cir.record, !cir.array, !cir.array} #cir.record.decl.ast> -!ty_StringStructPtr = !cir.record} #cir.record.decl.ast> -!ty_anon2E1_ = !cir.record)>>} #cir.record.decl.ast> +!rec_A = !cir.record x 2>} #cir.record.decl.ast> +!rec_Bar = !cir.record +!rec_StringStruct = !cir.record, !cir.array, !cir.array} #cir.record.decl.ast> +!rec_StringStructPtr = !cir.record} #cir.record.decl.ast> +!rec_anon2E1_ = !cir.record)>>} #cir.record.decl.ast> module { cir.global external @a = #cir.int<3> : !s32i @@ -98,11 +98,11 @@ module { // The following tests check direclty the resulting LLVM IR because the MLIR // version is two long. Always prefer the MLIR prefix when possible. - cir.global external @nestedTwoDim = #cir.const_record<{#cir.int<1> : !s32i, #cir.const_array<[#cir.const_array<[#cir.int<2> : !s32i, #cir.int<3> : !s32i]> : !cir.array, #cir.const_array<[#cir.int<4> : !s32i, #cir.int<5> : !s32i]> : !cir.array]> : !cir.array x 2>}> : !ty_A + cir.global external @nestedTwoDim = #cir.const_record<{#cir.int<1> : !s32i, #cir.const_array<[#cir.const_array<[#cir.int<2> : !s32i, #cir.int<3> : !s32i]> : !cir.array, #cir.const_array<[#cir.int<4> : !s32i, #cir.int<5> : !s32i]> : !cir.array]> : !cir.array x 2>}> : !rec_A // LLVM: @nestedTwoDim = global %struct.A { i32 1, [2 x [2 x i32{{\]\] \[\[}}2 x i32] [i32 2, i32 3], [2 x i32] [i32 4, i32 5{{\]\]}} } - cir.global external @nestedString = #cir.const_record<{#cir.const_array<"1\00\00" : !cir.array> : !cir.array, #cir.const_array<"\00\00\00" : !cir.array> : !cir.array, #cir.const_array<"\00\00\00" : !cir.array> : !cir.array}> : !ty_StringStruct + cir.global external @nestedString = #cir.const_record<{#cir.const_array<"1\00\00" : !cir.array> : !cir.array, #cir.const_array<"\00\00\00" : !cir.array> : !cir.array, #cir.const_array<"\00\00\00" : !cir.array> : !cir.array}> : !rec_StringStruct // LLVM: @nestedString = global %struct.StringStruct { [3 x i8] c"1\00\00", [3 x i8] zeroinitializer, [3 x i8] zeroinitializer } - cir.global external @nestedStringPtr = #cir.const_record<{#cir.global_view<@".str"> : !cir.ptr}> : !ty_StringStructPtr + cir.global external @nestedStringPtr = #cir.const_record<{#cir.global_view<@".str"> : !cir.ptr}> : !rec_StringStructPtr // LLVM: @nestedStringPtr = global %struct.StringStructPtr { ptr @.str } cir.func @_Z11get_globalsv() { @@ -149,7 +149,7 @@ module { // MLIR: %0 = llvm.mlir.zero : !llvm.ptr // MLIR: llvm.return %0 : !llvm.ptr // MLIR: } - cir.global external @zeroStruct = #cir.zero : !ty_Bar + cir.global external @zeroStruct = #cir.zero : !rec_Bar // MLIR: llvm.mlir.global external @zeroStruct() // MLIR: %0 = llvm.mlir.zero : !llvm.struct<"struct.Bar", (i32, i8)> // MLIR: llvm.return %0 : !llvm.struct<"struct.Bar", (i32, i8)> @@ -157,14 +157,14 @@ module { cir.global common @comm = #cir.int<0> : !s32i // MLIR: llvm.mlir.global common @comm(0 : i32) {addr_space = 0 : i32} : i32 - cir.global external @undefStruct = #cir.undef : !ty_Bar + cir.global external @undefStruct = #cir.undef : !rec_Bar // MLIR: llvm.mlir.global external @undefStruct() // MLIR: %0 = llvm.mlir.undef : !llvm.struct<"struct.Bar", (i32, i8)> // MLIR: llvm.return %0 : !llvm.struct<"struct.Bar", (i32, i8)> // MLIR: } // LLVM: @undefStruct = global %struct.Bar undef - cir.global "private" internal @Handlers = #cir.const_array<[#cir.const_record<{#cir.global_view<@myfun> : !cir.ptr>}> : !ty_anon2E1_]> : !cir.array + cir.global "private" internal @Handlers = #cir.const_array<[#cir.const_record<{#cir.global_view<@myfun> : !cir.ptr>}> : !rec_anon2E1_]> : !cir.array cir.func internal private @myfun(%arg0: !s32i) { %0 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} cir.store %arg0, %0 : !s32i, !cir.ptr @@ -175,11 +175,11 @@ module { %1 = cir.alloca !s32i, !cir.ptr, ["flag", init] {alignment = 4 : i64} cir.store %arg0, %0 : !s32i, !cir.ptr cir.store %arg1, %1 : !s32i, !cir.ptr - %2 = cir.get_global @Handlers : !cir.ptr> + %2 = cir.get_global @Handlers : !cir.ptr> %3 = cir.load %0 : !cir.ptr, !s32i - %4 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr - %5 = cir.ptr_stride(%4 : !cir.ptr, %3 : !s32i), !cir.ptr - %6 = cir.get_member %5[0] {name = "func"} : !cir.ptr -> !cir.ptr>> + %4 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr + %5 = cir.ptr_stride(%4 : !cir.ptr, %3 : !s32i), !cir.ptr + %6 = cir.get_member %5[0] {name = "func"} : !cir.ptr -> !cir.ptr>> %7 = cir.load %6 : !cir.ptr>>, !cir.ptr> %8 = cir.load %1 : !cir.ptr, !s32i cir.call %7(%8) : (!cir.ptr>, !s32i) -> () diff --git a/clang/test/CIR/Lowering/struct.cir b/clang/test/CIR/Lowering/struct.cir index beac6fcd9b8c..832ce20861d8 100644 --- a/clang/test/CIR/Lowering/struct.cir +++ b/clang/test/CIR/Lowering/struct.cir @@ -4,45 +4,45 @@ !s32i = !cir.int !u8i = !cir.int !u32i = !cir.int -!ty_S = !cir.record -!ty_S2A = !cir.record -!ty_S1_ = !cir.record} #cir.record.decl.ast> -!ty_S2_ = !cir.record -!ty_S3_ = !cir.record +!rec_S = !cir.record +!rec_S2A = !cir.record +!rec_S1_ = !cir.record} #cir.record.decl.ast> +!rec_S2_ = !cir.record +!rec_S3_ = !cir.record !struct_with_bool = !cir.record module { cir.func @test() { - %1 = cir.alloca !ty_S, !cir.ptr, ["x"] {alignment = 4 : i64} + %1 = cir.alloca !rec_S, !cir.ptr, ["x"] {alignment = 4 : i64} // CHECK: %[[#ARRSIZE:]] = llvm.mlir.constant(1 : index) : i64 // CHECK: %[[#STRUCT:]] = llvm.alloca %[[#ARRSIZE]] x !llvm.struct<"struct.S", (i8, i32)> - %3 = cir.get_member %1[0] {name = "c"} : !cir.ptr -> !cir.ptr + %3 = cir.get_member %1[0] {name = "c"} : !cir.ptr -> !cir.ptr // CHECK: = llvm.getelementptr %[[#STRUCT]][0, 0] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"struct.S", (i8, i32)> - %5 = cir.get_member %1[1] {name = "i"} : !cir.ptr -> !cir.ptr + %5 = cir.get_member %1[1] {name = "i"} : !cir.ptr -> !cir.ptr // CHECK: = llvm.getelementptr %[[#STRUCT]][0, 1] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"struct.S", (i8, i32)> cir.return } // CHECK-LABEL: @test_value cir.func @test_value() { - %0 = cir.const #cir.const_record<{#cir.int<1> : !u8i, #cir.int<2> : !s32i}> : !ty_S + %0 = cir.const #cir.const_record<{#cir.int<1> : !u8i, #cir.int<2> : !s32i}> : !rec_S // CHECK: %[[#v0:]] = llvm.mlir.undef : !llvm.struct<"struct.S", (i8, i32)> // CHECK-NEXT: %[[#v1:]] = llvm.mlir.constant(1 : i8) : i8 // CHECK-NEXT: %[[#v2:]] = llvm.insertvalue %[[#v1]], %[[#v0]][0] : !llvm.struct<"struct.S", (i8, i32)> // CHECK-NEXT: %[[#v3:]] = llvm.mlir.constant(2 : i32) : i32 // CHECK-NEXT: %[[#v4:]] = llvm.insertvalue %[[#v3]], %[[#v2]][1] : !llvm.struct<"struct.S", (i8, i32)> - %1 = cir.extract_member %0[0] : !ty_S -> !u8i + %1 = cir.extract_member %0[0] : !rec_S -> !u8i // CHECK-NEXT: %{{.+}} = llvm.extractvalue %[[#v4]][0] : !llvm.struct<"struct.S", (i8, i32)> - %2 = cir.extract_member %0[1] : !ty_S -> !s32i + %2 = cir.extract_member %0[1] : !rec_S -> !s32i // CHECK-NEXT: %{{.+}} = llvm.extractvalue %[[#v4]][1] : !llvm.struct<"struct.S", (i8, i32)> cir.return } cir.func @shouldConstInitLocalStructsWithConstStructAttr() { - %0 = cir.alloca !ty_S2A, !cir.ptr, ["s"] {alignment = 4 : i64} - %1 = cir.const #cir.const_record<{#cir.int<1> : !s32i}> : !ty_S2A - cir.store %1, %0 : !ty_S2A, !cir.ptr + %0 = cir.alloca !rec_S2A, !cir.ptr, ["s"] {alignment = 4 : i64} + %1 = cir.const #cir.const_record<{#cir.int<1> : !s32i}> : !rec_S2A + cir.store %1, %0 : !rec_S2A, !cir.ptr cir.return } // CHECK: llvm.func @shouldConstInitLocalStructsWithConstStructAttr() @@ -56,7 +56,7 @@ module { // CHECK: } // Should lower basic #cir.const_record initializer. - cir.global external @s1 = #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<1.000000e-01> : !cir.float, #cir.ptr : !cir.ptr}> : !ty_S1_ + cir.global external @s1 = #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<1.000000e-01> : !cir.float, #cir.ptr : !cir.ptr}> : !rec_S1_ // CHECK: llvm.mlir.global external @s1() {addr_space = 0 : i32} : !llvm.struct<"struct.S1", (i32, f32, ptr)> { // CHECK: %0 = llvm.mlir.undef : !llvm.struct<"struct.S1", (i32, f32, ptr)> // CHECK: %1 = llvm.mlir.constant(1 : i32) : i32 @@ -69,7 +69,7 @@ module { // CHECK: } // Should lower nested #cir.const_record initializer. - cir.global external @s2 = #cir.const_record<{#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S2A}> : !ty_S2_ + cir.global external @s2 = #cir.const_record<{#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S2A}> : !rec_S2_ // CHECK: llvm.mlir.global external @s2() {addr_space = 0 : i32} : !llvm.struct<"struct.S2", (struct<"struct.S2A", (i32)>)> { // CHECK: %0 = llvm.mlir.undef : !llvm.struct<"struct.S2", (struct<"struct.S2A", (i32)>)> // CHECK: %1 = llvm.mlir.undef : !llvm.struct<"struct.S2A", (i32)> @@ -79,7 +79,7 @@ module { // CHECK: llvm.return %4 : !llvm.struct<"struct.S2", (struct<"struct.S2A", (i32)>)> // CHECK: } - cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !ty_S3_, #cir.const_record<{#cir.int<2> : !s32i}> : !ty_S3_, #cir.const_record<{#cir.int<3> : !s32i}> : !ty_S3_]> : !cir.array + cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S3_, #cir.const_record<{#cir.int<2> : !s32i}> : !rec_S3_, #cir.const_record<{#cir.int<3> : !s32i}> : !rec_S3_]> : !cir.array // CHECK: llvm.mlir.global external @s3() {addr_space = 0 : i32} : !llvm.array<3 x struct<"struct.S3", (i32)>> { // CHECK: %0 = llvm.mlir.undef : !llvm.array<3 x struct<"struct.S3", (i32)>> // CHECK: %1 = llvm.mlir.undef : !llvm.struct<"struct.S3", (i32)> @@ -99,13 +99,13 @@ module { cir.func @shouldLowerStructCopies() { // CHECK: llvm.func @shouldLowerStructCopies() - %1 = cir.alloca !ty_S, !cir.ptr, ["a"] {alignment = 4 : i64} + %1 = cir.alloca !rec_S, !cir.ptr, ["a"] {alignment = 4 : i64} // CHECK: %[[#ONE:]] = llvm.mlir.constant(1 : index) : i64 // CHECK: %[[#SA:]] = llvm.alloca %[[#ONE]] x !llvm.struct<"struct.S", (i8, i32)> {alignment = 4 : i64} : (i64) -> !llvm.ptr - %2 = cir.alloca !ty_S, !cir.ptr, ["b", init] {alignment = 4 : i64} + %2 = cir.alloca !rec_S, !cir.ptr, ["b", init] {alignment = 4 : i64} // CHECK: %[[#ONE:]] = llvm.mlir.constant(1 : index) : i64 // CHECK: %[[#SB:]] = llvm.alloca %[[#ONE]] x !llvm.struct<"struct.S", (i8, i32)> {alignment = 4 : i64} : (i64) -> !llvm.ptr - cir.copy %1 to %2 : !cir.ptr + cir.copy %1 to %2 : !cir.ptr // CHECK: %[[#SIZE:]] = llvm.mlir.constant(8 : i32) : i32 // CHECK: "llvm.intr.memcpy"(%[[#SB]], %[[#SA]], %[[#SIZE]]) <{isVolatile = false}> : (!llvm.ptr, !llvm.ptr, i32) -> () cir.return diff --git a/clang/test/CIR/Lowering/unions.cir b/clang/test/CIR/Lowering/unions.cir index 8f674b6fedc4..ae67c72003ad 100644 --- a/clang/test/CIR/Lowering/unions.cir +++ b/clang/test/CIR/Lowering/unions.cir @@ -4,26 +4,26 @@ !s16i = !cir.int !s32i = !cir.int #true = #cir.bool : !cir.bool -!ty_U1_ = !cir.record -!ty_U2_ = !cir.record -!ty_U3_ = !cir.record +!rec_U1_ = !cir.record +!rec_U2_ = !cir.record +!rec_U3_ = !cir.record module { // Should lower union to struct with only the largest member. - cir.global external @u1 = #cir.zero : !ty_U1_ + cir.global external @u1 = #cir.zero : !rec_U1_ // CHECK: llvm.mlir.global external @u1() {addr_space = 0 : i32} : !llvm.struct<"union.U1", (i32)> // Should recursively find the largest member if there are nested unions. - cir.global external @u2 = #cir.zero : !ty_U2_ - cir.global external @u3 = #cir.zero : !ty_U3_ + cir.global external @u2 = #cir.zero : !rec_U2_ + cir.global external @u3 = #cir.zero : !rec_U3_ // CHECK: llvm.mlir.global external @u2() {addr_space = 0 : i32} : !llvm.struct<"union.U2", (f64)> // CHECK: llvm.mlir.global external @u3() {addr_space = 0 : i32} : !llvm.struct<"union.U3", (struct<"union.U1", (i32)>)> // CHECK: llvm.func @test - cir.func @test(%arg0: !cir.ptr) { + cir.func @test(%arg0: !cir.ptr) { // Should store directly to the union's base address. %5 = cir.const #true - %6 = cir.get_member %arg0[0] {name = "b"} : !cir.ptr -> !cir.ptr + %6 = cir.get_member %arg0[0] {name = "b"} : !cir.ptr -> !cir.ptr cir.store %5, %6 : !cir.bool, !cir.ptr // CHECK: %[[#TRUE:]] = llvm.mlir.constant(true) : i1 // The bitcast it just to bypass the type checker. It will be replaced by an opaque pointer. @@ -32,7 +32,7 @@ module { // CHECK: llvm.store %[[#VAL]], %[[#ADDR]] {{.*}}: i8, !llvm.ptr // Should load direclty from the union's base address. - %7 = cir.get_member %arg0[0] {name = "b"} : !cir.ptr -> !cir.ptr + %7 = cir.get_member %arg0[0] {name = "b"} : !cir.ptr -> !cir.ptr %8 = cir.load %7 : !cir.ptr, !cir.bool // The bitcast it just to bypass the type checker. It will be replaced by an opaque pointer. // CHECK: %[[#BASE:]] = llvm.bitcast %{{.+}} : !llvm.ptr diff --git a/clang/test/CIR/Lowering/var-arg-x86_64.c b/clang/test/CIR/Lowering/var-arg-x86_64.c index 977d938dbb1b..35a531620b7a 100644 --- a/clang/test/CIR/Lowering/var-arg-x86_64.c +++ b/clang/test/CIR/Lowering/var-arg-x86_64.c @@ -42,7 +42,7 @@ double f1(int n, ...) { // CHECK: call {{.*}}@llvm.va_end.p0(ptr [[VA_LIST3]]) // CIR: cir.func @f1 -// CIR: [[VA_LIST_ALLOCA:%.+]] = cir.alloca !cir.array, +// CIR: [[VA_LIST_ALLOCA:%.+]] = cir.alloca !cir.array, // CIR: [[RES:%.+]] = cir.alloca !cir.double, !cir.ptr, ["res", // CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] // CIR: cir.va.start [[VASTED_VA_LIST]] @@ -111,7 +111,7 @@ long double f2(int n, ...) { // CHECK: ret x86_fp80 [[RETURN_VALUE]] // CIR: cir.func @f2 -// CIR: [[VA_LIST_ALLOCA:%.+]] = cir.alloca !cir.array, !cir.ptr>, ["valist"] +// CIR: [[VA_LIST_ALLOCA:%.+]] = cir.alloca !cir.array, !cir.ptr>, ["valist"] // CIR: [[RES:%.+]] = cir.alloca !cir.long_double, !cir.ptr>, ["res" // CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] // CIR: cir.va.start [[VASTED_VA_LIST]] diff --git a/clang/test/CIR/Lowering/variadics.cir b/clang/test/CIR/Lowering/variadics.cir index 116137d58c70..d549c9fd6a4a 100644 --- a/clang/test/CIR/Lowering/variadics.cir +++ b/clang/test/CIR/Lowering/variadics.cir @@ -5,30 +5,30 @@ !u32i = !cir.int !u8i = !cir.int -!ty___va_list_tag = !cir.record, !cir.ptr} #cir.record.decl.ast> +!rec___va_list_tag = !cir.record, !cir.ptr} #cir.record.decl.ast> module { cir.func @average(%arg0: !s32i, ...) -> !s32i { %0 = cir.alloca !s32i, !cir.ptr, ["count", init] {alignment = 4 : i64} %1 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} - %2 = cir.alloca !cir.array, !cir.ptr>, ["args"] {alignment = 16 : i64} - %3 = cir.alloca !cir.array, !cir.ptr>, ["args_copy"] {alignment = 16 : i64} + %2 = cir.alloca !cir.array, !cir.ptr>, ["args"] {alignment = 16 : i64} + %3 = cir.alloca !cir.array, !cir.ptr>, ["args_copy"] {alignment = 16 : i64} cir.store %arg0, %0 : !s32i, !cir.ptr - %4 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr - cir.va.start %4 : !cir.ptr + %4 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr + cir.va.start %4 : !cir.ptr // MLIR: %{{[0-9]+}} = llvm.getelementptr %{{[0-9]+}}[0] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"struct.__va_list_tag", (i32, i32, ptr, ptr)> // MLIR-NEXT: %{{[0-9]+}} = llvm.bitcast %{{[0-9]+}} : !llvm.ptr to !llvm.ptr // MLIR-NEXT: llvm.intr.vastart %{{[0-9]+}} : !llvm.ptr - %5 = cir.cast(array_to_ptrdecay, %3 : !cir.ptr>), !cir.ptr - %6 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr - cir.va.copy %6 to %5 : !cir.ptr, !cir.ptr + %5 = cir.cast(array_to_ptrdecay, %3 : !cir.ptr>), !cir.ptr + %6 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr + cir.va.copy %6 to %5 : !cir.ptr, !cir.ptr // MLIR: %{{[0-9]+}} = llvm.getelementptr %{{[0-9]+}}[0] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"struct.__va_list_tag", (i32, i32, ptr, ptr)> // MLIR-NEXT: %{{[0-9]+}} = llvm.getelementptr %{{[0-9]+}}[0] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"struct.__va_list_tag", (i32, i32, ptr, ptr)> // MLIR-NEXT: %{{[0-9]+}} = llvm.bitcast %{{[0-9]+}} : !llvm.ptr to !llvm.ptr // MLIR-NEXT: %{{[0-9]+}} = llvm.bitcast %{{[0-9]+}} : !llvm.ptr to !llvm.ptr // MLIR-NEXT: llvm.intr.vacopy %13 to %{{[0-9]+}} : !llvm.ptr, !llvm.ptr - %7 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr - cir.va.end %7 : !cir.ptr + %7 = cir.cast(array_to_ptrdecay, %2 : !cir.ptr>), !cir.ptr + cir.va.end %7 : !cir.ptr // MLIR: %{{[0-9]+}} = llvm.getelementptr %{{[0-9]+}}[0] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"struct.__va_list_tag", (i32, i32, ptr, ptr)> // MLIR-NEXT: %{{[0-9]+}} = llvm.bitcast %{{[0-9]+}} : !llvm.ptr to !llvm.ptr // MLIR-NEXT: llvm.intr.vaend %{{[0-9]+}} : !llvm.ptr