Skip to content

Commit 168ca49

Browse files
committed
adapting tests to new changes from upstream
1 parent 6e9d966 commit 168ca49

File tree

2 files changed

+46
-44
lines changed

2 files changed

+46
-44
lines changed

clang/test/CIR/CodeGen/var-arg-float.c

+23-22
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@ double f1(int n, ...) {
1414

1515
// BEFORE: !ty_22__va_list22 = !cir.struct<struct "__va_list" {!cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.int<s, 32>, !cir.int<s, 32>}
1616
// BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !cir.double
17-
// BEFORE: [[RETP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["__retval"]
18-
// BEFORE: [[RESP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["res", init]
17+
// BEFORE: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["__retval"]
18+
// BEFORE: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["res", init]
1919
// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
2020
// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr<!ty_22__va_list22>) -> !cir.double
21-
// BEFORE: cir.store [[TMP0]], [[RESP]] : !cir.double, cir.ptr <!cir.double>
21+
// BEFORE: cir.store [[TMP0]], [[RESP]] : !cir.double, !cir.ptr<!cir.double>
2222
// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
23-
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!cir.double>, !cir.double
24-
// BEFORE: cir.store [[RES]], [[RETP]] : !cir.double, cir.ptr <!cir.double>
25-
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!cir.double>, !cir.double
23+
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!cir.double>, !cir.double
24+
// BEFORE: cir.store [[RES]], [[RETP]] : !cir.double, !cir.ptr<!cir.double>
25+
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!cir.double>, !cir.double
2626
// BEFORE: cir.return [[RETV]] : !cir.double
2727

2828
// AFTER: !ty_22__va_list22 = !cir.struct<struct "__va_list" {!cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.int<s, 32>, !cir.int<s, 32>}
2929
// LLVM: %struct.__va_list = type { ptr, ptr, ptr, i32, i32 }
3030
// AFTER: cir.func @f1(%arg0: !s32i, ...) -> !cir.double
3131
// LLVM: define double @f1(i32 %0, ...)
3232
// LLVM: [[ARGN:%.*]] = alloca i32, i64 1, align 4,
33-
// AFTER: [[RETP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["__retval"]
33+
// AFTER: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["__retval"]
3434
// LLVM: [[RETP:%.*]] = alloca double, i64 1, align 8,
35-
// AFTER: [[RESP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["res", init]
35+
// AFTER: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["res", init]
3636
// LLVM: [[RESP:%.*]] = alloca double, i64 1, align 8,
3737
// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
3838
// LLVM: call void @llvm.va_start.p0(ptr [[VARLIST:%.*]]),
3939
// AFTER: [[VR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][4] {name = "vr_offs"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!s32i>
4040
// LLVM: [[VR_OFFS_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 4
41-
// AFTER: [[VR_OFFS:%.*]] = cir.load [[VR_OFFS_P]] : cir.ptr <!s32i>, !s32i
41+
// AFTER: [[VR_OFFS:%.*]] = cir.load [[VR_OFFS_P]] : !cir.ptr<!s32i>, !s32i
4242
// LLVM: [[VR_OFFS:%.*]] = load i32, ptr [[VR_OFFS_P]], align 4,
43-
// AFTER: [[ZERO:%.*]] = cir.const(#cir.int<0> : !s32i) : !s32i
43+
// AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i
4444
// AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[VR_OFFS]], [[ZERO]]) : !s32i, !cir.bool
4545
// LLVM-NEXT: [[CMP0:%.*]] = icmp sge i32 [[VR_OFFS]], 0,
4646
// AFTER-NEXT: cir.brcond [[CMP0]] [[BB_ON_STACK:\^bb.*]], [[BB_MAY_REG:\^bb.*]]
@@ -50,27 +50,27 @@ double f1(int n, ...) {
5050
// LLVM: [[BB_END:.*]]: ; preds = %[[BB_ON_STACK]], %[[BB_IN_REG:.*]]
5151
// AFTER-NEXT: [[TMP0:%.*]] = cir.cast(bitcast, [[BLK_ARG]] : !cir.ptr<!void>), !cir.ptr<!cir.double>
5252
// LLVM-NEXT: [[PHIP:%.*]] = phi ptr [ [[IN_REG_OUTPUT:%.*]], %[[BB_IN_REG]] ], [ [[STACK_V:%.*]], %[[BB_ON_STACK]] ]
53-
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : cir.ptr <!cir.double>, !cir.double
53+
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr<!cir.double>, !cir.double
5454
// LLVM-NEXT: [[PHIV:%.*]] = load double, ptr [[PHIP]], align 8,
55-
// AFTER: cir.store [[TMP1]], [[RESP]] : !cir.double, cir.ptr <!cir.double>
55+
// AFTER: cir.store [[TMP1]], [[RESP]] : !cir.double, !cir.ptr<!cir.double>
5656
// LLVM-NEXT: store double [[PHIV]], ptr [[RESP]], align 8,
5757
// AFTER: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
5858
// LLVM: call void @llvm.va_end.p0(ptr [[VARLIST]]),
59-
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!cir.double>, !cir.double
59+
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!cir.double>, !cir.double
6060
// LLVM: [[RES:%.*]] = load double, ptr [[RESP]], align 8,
61-
// AFTER: cir.store [[RES]], [[RETP]] : !cir.double, cir.ptr <!cir.double>
61+
// AFTER: cir.store [[RES]], [[RETP]] : !cir.double, !cir.ptr<!cir.double>
6262
// LLVM: store double [[RES]], ptr [[RETP]], align 8,
63-
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!cir.double>, !cir.double
63+
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!cir.double>, !cir.double
6464
// LLVM: [[RETV:%.*]] = load double, ptr [[RETP]], align 8,
6565
// AFTER: cir.return [[RETV]] : !cir.double
6666
// LLVM-NEXT: ret double [[RETV]],
6767

6868
// AFTER: [[BB_MAY_REG]]: // pred: [[BB_BEGIN:\^bb.*]]
6969
// LLVM: [[BB_MAY_REG]]: ; preds = %[[BB_BEGIN:.*]]
70-
// AFTER-NEXT: [[SIXTEEN:%.*]] = cir.const(#cir.int<16> : !s32i) : !s32i
70+
// AFTER-NEXT: [[SIXTEEN:%.*]] = cir.const #cir.int<16> : !s32i
7171
// AFTER-NEXT: [[NEW_REG_OFFS:%.*]] = cir.binop(add, [[VR_OFFS]], [[SIXTEEN]]) : !s32i
7272
// LLVM-NEXT: [[NEW_REG_OFFS:%.*]] = add i32 [[VR_OFFS]], 16,
73-
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[VR_OFFS_P]] : !s32i, cir.ptr <!s32i>
73+
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[VR_OFFS_P]] : !s32i, !cir.ptr<!s32i>
7474
// LLVM-NEXT: store i32 [[NEW_REG_OFFS]], ptr [[VR_OFFS_P]], align 4,
7575
// AFTER-NEXT: [[CMP1:%.*]] = cir.cmp(le, [[NEW_REG_OFFS]], [[ZERO]]) : !s32i, !cir.bool
7676
// LLVM-NEXT: [[CMP1:%.*]] = icmp sle i32 [[NEW_REG_OFFS]], 0,
@@ -81,11 +81,12 @@ double f1(int n, ...) {
8181
// LLVM: [[BB_IN_REG]]: ; preds = %[[BB_MAY_REG]]
8282
// AFTER-NEXT: [[VR_TOP_P:%.*]] = cir.get_member [[VARLIST]][2] {name = "vr_top"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
8383
// LLVM-NEXT: [[VR_TOP_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 2,
84-
// AFTER-NEXT: [[VR_TOP:%.*]] = cir.load [[VR_TOP_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
84+
// AFTER-NEXT: [[VR_TOP:%.*]] = cir.load [[VR_TOP_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
8585
// LLVM-NEXT: [[VR_TOP:%.*]] = load ptr, ptr [[VR_TOP_P]], align 8,
8686
// AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[VR_TOP]] : !cir.ptr<!void>), !cir.ptr<i8>
8787
// AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr<i8>, [[VR_OFFS]] : !s32i), !cir.ptr<i8>
88-
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[VR_TOP]], i32 [[VR_OFFS]],
88+
// LLVM-NEXT: [[EXT64_VR_OFFS:%.*]] = sext i32 [[VR_OFFS]] to i64,
89+
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[VR_TOP]], i64 [[EXT64_VR_OFFS]],
8990
// AFTER-NEXT: [[IN_REG_OUTPUT:%.*]] = cir.cast(bitcast, [[TMP3]] : !cir.ptr<i8>), !cir.ptr<!void>
9091
// AFTER-NEXT: cir.br [[BB_END]]([[IN_REG_OUTPUT]] : !cir.ptr<!void>)
9192
// LLVM-NEXT: br label %[[BB_END]],
@@ -94,14 +95,14 @@ double f1(int n, ...) {
9495
// LLVM: [[BB_ON_STACK]]: ; preds = %[[BB_MAY_REG]], %[[BB_BEGIN]]
9596
// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
9697
// LLVM-NEXT: [[STACK_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 0,
97-
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
98+
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
9899
// LLVM-NEXT: [[STACK_V]] = load ptr, ptr [[STACK_P]], align 8,
99-
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const(#cir.int<8> : !u64i) : !u64i
100+
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i
100101
// AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr<!void>), !cir.ptr<i8>
101102
// AFTER-NEXT: [[TMP5:%.*]] = cir.ptr_stride([[TMP4]] : !cir.ptr<i8>, [[EIGHT_IN_PTR_ARITH]] : !u64i), !cir.ptr<i8>
102103
// LLVM-NEXT: [[NEW_STACK_V:%.*]] = getelementptr i8, ptr [[STACK_V]], i32 8,
103104
// AFTER-NEXT: [[NEW_STACK_V:%.*]] = cir.cast(bitcast, [[TMP5]] : !cir.ptr<i8>), !cir.ptr<!void>
104-
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, cir.ptr <!cir.ptr<!void>>
105+
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>
105106
// LLVM-NEXT: store ptr [[NEW_STACK_V]], ptr [[STACK_P]], align 8,
106107
// AFTER-NEXT: cir.br [[BB_END]]([[STACK_V]] : !cir.ptr<!void>)
107108
// LLVM-NEXT: br label %[[BB_END]],

clang/test/CIR/CodeGen/var-arg.c

+23-22
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@ int f1(int n, ...) {
1414

1515
// BEFORE: !ty_22__va_list22 = !cir.struct<struct "__va_list" {!cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.int<s, 32>, !cir.int<s, 32>}
1616
// BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !s32i
17-
// BEFORE: [[RETP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["__retval"]
18-
// BEFORE: [[RESP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["res", init]
17+
// BEFORE: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"]
18+
// BEFORE: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["res", init]
1919
// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
2020
// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr<!ty_22__va_list22>) -> !s32i
21-
// BEFORE: cir.store [[TMP0]], [[RESP]] : !s32i, cir.ptr <!s32i>
21+
// BEFORE: cir.store [[TMP0]], [[RESP]] : !s32i, !cir.ptr<!s32i>
2222
// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
23-
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!s32i>, !s32i
24-
// BEFORE: cir.store [[RES]], [[RETP]] : !s32i, cir.ptr <!s32i>
25-
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!s32i>, !s32i
23+
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!s32i>, !s32i
24+
// BEFORE: cir.store [[RES]], [[RETP]] : !s32i, !cir.ptr<!s32i>
25+
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!s32i>, !s32i
2626
// BEFORE: cir.return [[RETV]] : !s32i
2727

2828
// AFTER: !ty_22__va_list22 = !cir.struct<struct "__va_list" {!cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.ptr<!cir.void>, !cir.int<s, 32>, !cir.int<s, 32>}
2929
// LLVM: %struct.__va_list = type { ptr, ptr, ptr, i32, i32 }
3030
// AFTER: cir.func @f1(%arg0: !s32i, ...) -> !s32i
3131
// LLVM: define i32 @f1(i32 %0, ...)
3232
// LLVM: [[ARGN:%.*]] = alloca i32, i64 1, align 4,
33-
// AFTER: [[RETP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["__retval"]
33+
// AFTER: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"]
3434
// LLVM: [[RETP:%.*]] = alloca i32, i64 1, align 4,
35-
// AFTER: [[RESP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["res", init]
35+
// AFTER: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["res", init]
3636
// LLVM: [[RESP:%.*]] = alloca i32, i64 1, align 4,
3737
// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
3838
// LLVM: call void @llvm.va_start.p0(ptr [[VARLIST:%.*]]),
3939
// AFTER: [[GR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][3] {name = "gr_offs"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!s32i>
4040
// LLVM: [[GR_OFFS_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 3
41-
// AFTER: [[GR_OFFS:%.*]] = cir.load [[GR_OFFS_P]] : cir.ptr <!s32i>, !s32i
41+
// AFTER: [[GR_OFFS:%.*]] = cir.load [[GR_OFFS_P]] : !cir.ptr<!s32i>, !s32i
4242
// LLVM: [[GR_OFFS:%.*]] = load i32, ptr [[GR_OFFS_P]], align 4,
43-
// AFTER: [[ZERO:%.*]] = cir.const(#cir.int<0> : !s32i) : !s32i
43+
// AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i
4444
// AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[GR_OFFS]], [[ZERO]]) : !s32i, !cir.bool
4545
// LLVM-NEXT: [[CMP0:%.*]] = icmp sge i32 [[GR_OFFS]], 0,
4646
// AFTER-NEXT: cir.brcond [[CMP0]] [[BB_ON_STACK:\^bb.*]], [[BB_MAY_REG:\^bb.*]]
@@ -50,27 +50,27 @@ int f1(int n, ...) {
5050
// LLVM: [[BB_END:.*]]: ; preds = %[[BB_ON_STACK]], %[[BB_IN_REG:.*]]
5151
// AFTER-NEXT: [[TMP0:%.*]] = cir.cast(bitcast, [[BLK_ARG]] : !cir.ptr<!void>), !cir.ptr<!s32i>
5252
// LLVM-NEXT: [[PHIP:%.*]] = phi ptr [ [[IN_REG_OUTPUT:%.*]], %[[BB_IN_REG]] ], [ [[STACK_V:%.*]], %[[BB_ON_STACK]] ]
53-
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : cir.ptr <!s32i>, !s32i
53+
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr<!s32i>, !s32i
5454
// LLVM-NEXT: [[PHIV:%.*]] = load i32, ptr [[PHIP]], align 4,
55-
// AFTER: cir.store [[TMP1]], [[RESP]] : !s32i, cir.ptr <!s32i>
55+
// AFTER: cir.store [[TMP1]], [[RESP]] : !s32i, !cir.ptr<!s32i>
5656
// LLVM-NEXT: store i32 [[PHIV]], ptr [[RESP]], align 4,
5757
// AFTER: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
5858
// LLVM: call void @llvm.va_end.p0(ptr [[VARLIST]]),
59-
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!s32i>, !s32i
59+
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!s32i>, !s32i
6060
// LLVM: [[RES:%.*]] = load i32, ptr [[RESP]], align 4,
61-
// AFTER: cir.store [[RES]], [[RETP]] : !s32i, cir.ptr <!s32i>
61+
// AFTER: cir.store [[RES]], [[RETP]] : !s32i, !cir.ptr<!s32i>
6262
// LLVM: store i32 [[RES]], ptr [[RETP]], align 4,
63-
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!s32i>, !s32i
63+
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!s32i>, !s32i
6464
// LLVM: [[RETV:%.*]] = load i32, ptr [[RETP]], align 4,
6565
// AFTER: cir.return [[RETV]] : !s32i
6666
// LLVM-NEXT: ret i32 [[RETV]],
6767

6868
// AFTER: [[BB_MAY_REG]]: // pred: [[BB_BEGIN:\^bb.*]]
6969
// LLVM: [[BB_MAY_REG]]: ; preds = %[[BB_BEGIN:.*]]
70-
// AFTER-NEXT: [[EIGHT:%.*]] = cir.const(#cir.int<8> : !s32i) : !s32i
70+
// AFTER-NEXT: [[EIGHT:%.*]] = cir.const #cir.int<8> : !s32i
7171
// AFTER-NEXT: [[NEW_REG_OFFS:%.*]] = cir.binop(add, [[GR_OFFS]], [[EIGHT]]) : !s32i
7272
// LLVM: [[NEW_REG_OFFS:%.*]] = add i32 [[GR_OFFS]], 8,
73-
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[GR_OFFS_P]] : !s32i, cir.ptr <!s32i>
73+
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[GR_OFFS_P]] : !s32i, !cir.ptr<!s32i>
7474
// LLVM: store i32 [[NEW_REG_OFFS]], ptr [[GR_OFFS_P]], align 4,
7575
// AFTER-NEXT: [[CMP1:%.*]] = cir.cmp(le, [[NEW_REG_OFFS]], [[ZERO]]) : !s32i, !cir.bool
7676
// LLVM-NEXT: [[CMP1:%.*]] = icmp sle i32 [[NEW_REG_OFFS]], 0,
@@ -81,11 +81,12 @@ int f1(int n, ...) {
8181
// LLVM: [[BB_IN_REG]]: ; preds = %[[BB_MAY_REG]]
8282
// AFTER-NEXT: [[GR_TOP_P:%.*]] = cir.get_member [[VARLIST]][1] {name = "gr_top"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
8383
// LLVM-NEXT: [[GR_TOP_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 1,
84-
// AFTER-NEXT: [[GR_TOP:%.*]] = cir.load [[GR_TOP_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
84+
// AFTER-NEXT: [[GR_TOP:%.*]] = cir.load [[GR_TOP_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
8585
// LLVM-NEXT: [[GR_TOP:%.*]] = load ptr, ptr [[GR_TOP_P]], align 8,
8686
// AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[GR_TOP]] : !cir.ptr<!void>), !cir.ptr<i8>
8787
// AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr<i8>, [[GR_OFFS]] : !s32i), !cir.ptr<i8>
88-
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[GR_TOP]], i32 [[GR_OFFS]],
88+
// LLVM-NEXT: [[EXT64_GR_OFFS:%.*]] = sext i32 [[GR_OFFS]] to i64,
89+
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[GR_TOP]], i64 [[EXT64_GR_OFFS]],
8990
// AFTER-NEXT: [[IN_REG_OUTPUT:%.*]] = cir.cast(bitcast, [[TMP3]] : !cir.ptr<i8>), !cir.ptr<!void>
9091
// AFTER-NEXT: cir.br [[BB_END]]([[IN_REG_OUTPUT]] : !cir.ptr<!void>)
9192
// LLVM-NEXT: br label %[[BB_END]],
@@ -94,14 +95,14 @@ int f1(int n, ...) {
9495
// LLVM: [[BB_ON_STACK]]: ; preds = %[[BB_MAY_REG]], %[[BB_BEGIN]]
9596
// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
9697
// LLVM-NEXT: [[STACK_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 0,
97-
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
98+
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
9899
// LLVM-NEXT: [[STACK_V]] = load ptr, ptr [[STACK_P]], align 8,
99-
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const(#cir.int<8> : !u64i) : !u64i
100+
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i
100101
// AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr<!void>), !cir.ptr<i8>
101102
// AFTER-NEXT: [[TMP5:%.*]] = cir.ptr_stride([[TMP4]] : !cir.ptr<i8>, [[EIGHT_IN_PTR_ARITH]] : !u64i), !cir.ptr<i8>
102103
// LLVM-NEXT: [[NEW_STACK_V:%.*]] = getelementptr i8, ptr [[STACK_V]], i32 8,
103104
// AFTER-NEXT: [[NEW_STACK_V:%.*]] = cir.cast(bitcast, [[TMP5]] : !cir.ptr<i8>), !cir.ptr<!void>
104-
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, cir.ptr <!cir.ptr<!void>>
105+
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>
105106
// LLVM-NEXT: store ptr [[NEW_STACK_V]], ptr [[STACK_P]], align 8,
106107
// AFTER-NEXT: cir.br [[BB_END]]([[STACK_V]] : !cir.ptr<!void>)
107108
// LLVM-NEXT: br label %[[BB_END]],

0 commit comments

Comments
 (0)