Skip to content

Commit

Permalink
adapting tests to new changes from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ghehg committed May 6, 2024
1 parent 6e9d966 commit 168ca49
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 44 deletions.
45 changes: 23 additions & 22 deletions clang/test/CIR/CodeGen/var-arg-float.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ double f1(int n, ...) {

// 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>}
// BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !cir.double
// BEFORE: [[RETP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["__retval"]
// BEFORE: [[RESP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["res", init]
// BEFORE: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["__retval"]
// BEFORE: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["res", init]
// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr<!ty_22__va_list22>) -> !cir.double
// BEFORE: cir.store [[TMP0]], [[RESP]] : !cir.double, cir.ptr <!cir.double>
// BEFORE: cir.store [[TMP0]], [[RESP]] : !cir.double, !cir.ptr<!cir.double>
// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!cir.double>, !cir.double
// BEFORE: cir.store [[RES]], [[RETP]] : !cir.double, cir.ptr <!cir.double>
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!cir.double>, !cir.double
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!cir.double>, !cir.double
// BEFORE: cir.store [[RES]], [[RETP]] : !cir.double, !cir.ptr<!cir.double>
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!cir.double>, !cir.double
// BEFORE: cir.return [[RETV]] : !cir.double

// 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>}
// LLVM: %struct.__va_list = type { ptr, ptr, ptr, i32, i32 }
// AFTER: cir.func @f1(%arg0: !s32i, ...) -> !cir.double
// LLVM: define double @f1(i32 %0, ...)
// LLVM: [[ARGN:%.*]] = alloca i32, i64 1, align 4,
// AFTER: [[RETP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["__retval"]
// AFTER: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["__retval"]
// LLVM: [[RETP:%.*]] = alloca double, i64 1, align 8,
// AFTER: [[RESP:%.*]] = cir.alloca !cir.double, cir.ptr <!cir.double>, ["res", init]
// AFTER: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["res", init]
// LLVM: [[RESP:%.*]] = alloca double, i64 1, align 8,
// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
// LLVM: call void @llvm.va_start.p0(ptr [[VARLIST:%.*]]),
// AFTER: [[VR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][4] {name = "vr_offs"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!s32i>
// LLVM: [[VR_OFFS_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 4
// AFTER: [[VR_OFFS:%.*]] = cir.load [[VR_OFFS_P]] : cir.ptr <!s32i>, !s32i
// AFTER: [[VR_OFFS:%.*]] = cir.load [[VR_OFFS_P]] : !cir.ptr<!s32i>, !s32i
// LLVM: [[VR_OFFS:%.*]] = load i32, ptr [[VR_OFFS_P]], align 4,
// AFTER: [[ZERO:%.*]] = cir.const(#cir.int<0> : !s32i) : !s32i
// AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i
// AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[VR_OFFS]], [[ZERO]]) : !s32i, !cir.bool
// LLVM-NEXT: [[CMP0:%.*]] = icmp sge i32 [[VR_OFFS]], 0,
// AFTER-NEXT: cir.brcond [[CMP0]] [[BB_ON_STACK:\^bb.*]], [[BB_MAY_REG:\^bb.*]]
Expand All @@ -50,27 +50,27 @@ double f1(int n, ...) {
// LLVM: [[BB_END:.*]]: ; preds = %[[BB_ON_STACK]], %[[BB_IN_REG:.*]]
// AFTER-NEXT: [[TMP0:%.*]] = cir.cast(bitcast, [[BLK_ARG]] : !cir.ptr<!void>), !cir.ptr<!cir.double>
// LLVM-NEXT: [[PHIP:%.*]] = phi ptr [ [[IN_REG_OUTPUT:%.*]], %[[BB_IN_REG]] ], [ [[STACK_V:%.*]], %[[BB_ON_STACK]] ]
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : cir.ptr <!cir.double>, !cir.double
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr<!cir.double>, !cir.double
// LLVM-NEXT: [[PHIV:%.*]] = load double, ptr [[PHIP]], align 8,
// AFTER: cir.store [[TMP1]], [[RESP]] : !cir.double, cir.ptr <!cir.double>
// AFTER: cir.store [[TMP1]], [[RESP]] : !cir.double, !cir.ptr<!cir.double>
// LLVM-NEXT: store double [[PHIV]], ptr [[RESP]], align 8,
// AFTER: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
// LLVM: call void @llvm.va_end.p0(ptr [[VARLIST]]),
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!cir.double>, !cir.double
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!cir.double>, !cir.double
// LLVM: [[RES:%.*]] = load double, ptr [[RESP]], align 8,
// AFTER: cir.store [[RES]], [[RETP]] : !cir.double, cir.ptr <!cir.double>
// AFTER: cir.store [[RES]], [[RETP]] : !cir.double, !cir.ptr<!cir.double>
// LLVM: store double [[RES]], ptr [[RETP]], align 8,
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!cir.double>, !cir.double
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!cir.double>, !cir.double
// LLVM: [[RETV:%.*]] = load double, ptr [[RETP]], align 8,
// AFTER: cir.return [[RETV]] : !cir.double
// LLVM-NEXT: ret double [[RETV]],

// AFTER: [[BB_MAY_REG]]: // pred: [[BB_BEGIN:\^bb.*]]
// LLVM: [[BB_MAY_REG]]: ; preds = %[[BB_BEGIN:.*]]
// AFTER-NEXT: [[SIXTEEN:%.*]] = cir.const(#cir.int<16> : !s32i) : !s32i
// AFTER-NEXT: [[SIXTEEN:%.*]] = cir.const #cir.int<16> : !s32i
// AFTER-NEXT: [[NEW_REG_OFFS:%.*]] = cir.binop(add, [[VR_OFFS]], [[SIXTEEN]]) : !s32i
// LLVM-NEXT: [[NEW_REG_OFFS:%.*]] = add i32 [[VR_OFFS]], 16,
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[VR_OFFS_P]] : !s32i, cir.ptr <!s32i>
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[VR_OFFS_P]] : !s32i, !cir.ptr<!s32i>
// LLVM-NEXT: store i32 [[NEW_REG_OFFS]], ptr [[VR_OFFS_P]], align 4,
// AFTER-NEXT: [[CMP1:%.*]] = cir.cmp(le, [[NEW_REG_OFFS]], [[ZERO]]) : !s32i, !cir.bool
// LLVM-NEXT: [[CMP1:%.*]] = icmp sle i32 [[NEW_REG_OFFS]], 0,
Expand All @@ -81,11 +81,12 @@ double f1(int n, ...) {
// LLVM: [[BB_IN_REG]]: ; preds = %[[BB_MAY_REG]]
// AFTER-NEXT: [[VR_TOP_P:%.*]] = cir.get_member [[VARLIST]][2] {name = "vr_top"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
// LLVM-NEXT: [[VR_TOP_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 2,
// AFTER-NEXT: [[VR_TOP:%.*]] = cir.load [[VR_TOP_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
// AFTER-NEXT: [[VR_TOP:%.*]] = cir.load [[VR_TOP_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
// LLVM-NEXT: [[VR_TOP:%.*]] = load ptr, ptr [[VR_TOP_P]], align 8,
// AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[VR_TOP]] : !cir.ptr<!void>), !cir.ptr<i8>
// AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr<i8>, [[VR_OFFS]] : !s32i), !cir.ptr<i8>
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[VR_TOP]], i32 [[VR_OFFS]],
// LLVM-NEXT: [[EXT64_VR_OFFS:%.*]] = sext i32 [[VR_OFFS]] to i64,
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[VR_TOP]], i64 [[EXT64_VR_OFFS]],
// AFTER-NEXT: [[IN_REG_OUTPUT:%.*]] = cir.cast(bitcast, [[TMP3]] : !cir.ptr<i8>), !cir.ptr<!void>
// AFTER-NEXT: cir.br [[BB_END]]([[IN_REG_OUTPUT]] : !cir.ptr<!void>)
// LLVM-NEXT: br label %[[BB_END]],
Expand All @@ -94,14 +95,14 @@ double f1(int n, ...) {
// LLVM: [[BB_ON_STACK]]: ; preds = %[[BB_MAY_REG]], %[[BB_BEGIN]]
// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
// LLVM-NEXT: [[STACK_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 0,
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
// LLVM-NEXT: [[STACK_V]] = load ptr, ptr [[STACK_P]], align 8,
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const(#cir.int<8> : !u64i) : !u64i
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i
// AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr<!void>), !cir.ptr<i8>
// AFTER-NEXT: [[TMP5:%.*]] = cir.ptr_stride([[TMP4]] : !cir.ptr<i8>, [[EIGHT_IN_PTR_ARITH]] : !u64i), !cir.ptr<i8>
// LLVM-NEXT: [[NEW_STACK_V:%.*]] = getelementptr i8, ptr [[STACK_V]], i32 8,
// AFTER-NEXT: [[NEW_STACK_V:%.*]] = cir.cast(bitcast, [[TMP5]] : !cir.ptr<i8>), !cir.ptr<!void>
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, cir.ptr <!cir.ptr<!void>>
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>
// LLVM-NEXT: store ptr [[NEW_STACK_V]], ptr [[STACK_P]], align 8,
// AFTER-NEXT: cir.br [[BB_END]]([[STACK_V]] : !cir.ptr<!void>)
// LLVM-NEXT: br label %[[BB_END]],
45 changes: 23 additions & 22 deletions clang/test/CIR/CodeGen/var-arg.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ int f1(int n, ...) {

// 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>}
// BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !s32i
// BEFORE: [[RETP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["__retval"]
// BEFORE: [[RESP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["res", init]
// BEFORE: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"]
// BEFORE: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["res", init]
// BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
// BEFORE: [[TMP0:%.*]] = cir.va.arg [[VARLIST]] : (!cir.ptr<!ty_22__va_list22>) -> !s32i
// BEFORE: cir.store [[TMP0]], [[RESP]] : !s32i, cir.ptr <!s32i>
// BEFORE: cir.store [[TMP0]], [[RESP]] : !s32i, !cir.ptr<!s32i>
// BEFORE: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!s32i>, !s32i
// BEFORE: cir.store [[RES]], [[RETP]] : !s32i, cir.ptr <!s32i>
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!s32i>, !s32i
// BEFORE: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!s32i>, !s32i
// BEFORE: cir.store [[RES]], [[RETP]] : !s32i, !cir.ptr<!s32i>
// BEFORE: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!s32i>, !s32i
// BEFORE: cir.return [[RETV]] : !s32i

// 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>}
// LLVM: %struct.__va_list = type { ptr, ptr, ptr, i32, i32 }
// AFTER: cir.func @f1(%arg0: !s32i, ...) -> !s32i
// LLVM: define i32 @f1(i32 %0, ...)
// LLVM: [[ARGN:%.*]] = alloca i32, i64 1, align 4,
// AFTER: [[RETP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["__retval"]
// AFTER: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"]
// LLVM: [[RETP:%.*]] = alloca i32, i64 1, align 4,
// AFTER: [[RESP:%.*]] = cir.alloca !s32i, cir.ptr <!s32i>, ["res", init]
// AFTER: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["res", init]
// LLVM: [[RESP:%.*]] = alloca i32, i64 1, align 4,
// AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr<!ty_22__va_list22>
// LLVM: call void @llvm.va_start.p0(ptr [[VARLIST:%.*]]),
// AFTER: [[GR_OFFS_P:%.*]] = cir.get_member [[VARLIST]][3] {name = "gr_offs"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!s32i>
// LLVM: [[GR_OFFS_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 3
// AFTER: [[GR_OFFS:%.*]] = cir.load [[GR_OFFS_P]] : cir.ptr <!s32i>, !s32i
// AFTER: [[GR_OFFS:%.*]] = cir.load [[GR_OFFS_P]] : !cir.ptr<!s32i>, !s32i
// LLVM: [[GR_OFFS:%.*]] = load i32, ptr [[GR_OFFS_P]], align 4,
// AFTER: [[ZERO:%.*]] = cir.const(#cir.int<0> : !s32i) : !s32i
// AFTER: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i
// AFTER: [[CMP0:%.*]] = cir.cmp(ge, [[GR_OFFS]], [[ZERO]]) : !s32i, !cir.bool
// LLVM-NEXT: [[CMP0:%.*]] = icmp sge i32 [[GR_OFFS]], 0,
// AFTER-NEXT: cir.brcond [[CMP0]] [[BB_ON_STACK:\^bb.*]], [[BB_MAY_REG:\^bb.*]]
Expand All @@ -50,27 +50,27 @@ int f1(int n, ...) {
// LLVM: [[BB_END:.*]]: ; preds = %[[BB_ON_STACK]], %[[BB_IN_REG:.*]]
// AFTER-NEXT: [[TMP0:%.*]] = cir.cast(bitcast, [[BLK_ARG]] : !cir.ptr<!void>), !cir.ptr<!s32i>
// LLVM-NEXT: [[PHIP:%.*]] = phi ptr [ [[IN_REG_OUTPUT:%.*]], %[[BB_IN_REG]] ], [ [[STACK_V:%.*]], %[[BB_ON_STACK]] ]
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : cir.ptr <!s32i>, !s32i
// AFTER-NEXT: [[TMP1:%.*]] = cir.load [[TMP0]] : !cir.ptr<!s32i>, !s32i
// LLVM-NEXT: [[PHIV:%.*]] = load i32, ptr [[PHIP]], align 4,
// AFTER: cir.store [[TMP1]], [[RESP]] : !s32i, cir.ptr <!s32i>
// AFTER: cir.store [[TMP1]], [[RESP]] : !s32i, !cir.ptr<!s32i>
// LLVM-NEXT: store i32 [[PHIV]], ptr [[RESP]], align 4,
// AFTER: cir.va.end [[VARLIST]] : !cir.ptr<!ty_22__va_list22>
// LLVM: call void @llvm.va_end.p0(ptr [[VARLIST]]),
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : cir.ptr <!s32i>, !s32i
// AFTER: [[RES:%.*]] = cir.load [[RESP]] : !cir.ptr<!s32i>, !s32i
// LLVM: [[RES:%.*]] = load i32, ptr [[RESP]], align 4,
// AFTER: cir.store [[RES]], [[RETP]] : !s32i, cir.ptr <!s32i>
// AFTER: cir.store [[RES]], [[RETP]] : !s32i, !cir.ptr<!s32i>
// LLVM: store i32 [[RES]], ptr [[RETP]], align 4,
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : cir.ptr <!s32i>, !s32i
// AFTER: [[RETV:%.*]] = cir.load [[RETP]] : !cir.ptr<!s32i>, !s32i
// LLVM: [[RETV:%.*]] = load i32, ptr [[RETP]], align 4,
// AFTER: cir.return [[RETV]] : !s32i
// LLVM-NEXT: ret i32 [[RETV]],

// AFTER: [[BB_MAY_REG]]: // pred: [[BB_BEGIN:\^bb.*]]
// LLVM: [[BB_MAY_REG]]: ; preds = %[[BB_BEGIN:.*]]
// AFTER-NEXT: [[EIGHT:%.*]] = cir.const(#cir.int<8> : !s32i) : !s32i
// AFTER-NEXT: [[EIGHT:%.*]] = cir.const #cir.int<8> : !s32i
// AFTER-NEXT: [[NEW_REG_OFFS:%.*]] = cir.binop(add, [[GR_OFFS]], [[EIGHT]]) : !s32i
// LLVM: [[NEW_REG_OFFS:%.*]] = add i32 [[GR_OFFS]], 8,
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[GR_OFFS_P]] : !s32i, cir.ptr <!s32i>
// AFTER-NEXT: cir.store [[NEW_REG_OFFS]], [[GR_OFFS_P]] : !s32i, !cir.ptr<!s32i>
// LLVM: store i32 [[NEW_REG_OFFS]], ptr [[GR_OFFS_P]], align 4,
// AFTER-NEXT: [[CMP1:%.*]] = cir.cmp(le, [[NEW_REG_OFFS]], [[ZERO]]) : !s32i, !cir.bool
// LLVM-NEXT: [[CMP1:%.*]] = icmp sle i32 [[NEW_REG_OFFS]], 0,
Expand All @@ -81,11 +81,12 @@ int f1(int n, ...) {
// LLVM: [[BB_IN_REG]]: ; preds = %[[BB_MAY_REG]]
// AFTER-NEXT: [[GR_TOP_P:%.*]] = cir.get_member [[VARLIST]][1] {name = "gr_top"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
// LLVM-NEXT: [[GR_TOP_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 1,
// AFTER-NEXT: [[GR_TOP:%.*]] = cir.load [[GR_TOP_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
// AFTER-NEXT: [[GR_TOP:%.*]] = cir.load [[GR_TOP_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
// LLVM-NEXT: [[GR_TOP:%.*]] = load ptr, ptr [[GR_TOP_P]], align 8,
// AFTER-NEXT: [[TMP2:%.*]] = cir.cast(bitcast, [[GR_TOP]] : !cir.ptr<!void>), !cir.ptr<i8>
// AFTER-NEXT: [[TMP3:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr<i8>, [[GR_OFFS]] : !s32i), !cir.ptr<i8>
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[GR_TOP]], i32 [[GR_OFFS]],
// LLVM-NEXT: [[EXT64_GR_OFFS:%.*]] = sext i32 [[GR_OFFS]] to i64,
// LLVM-NEXT: [[IN_REG_OUTPUT]] = getelementptr i8, ptr [[GR_TOP]], i64 [[EXT64_GR_OFFS]],
// AFTER-NEXT: [[IN_REG_OUTPUT:%.*]] = cir.cast(bitcast, [[TMP3]] : !cir.ptr<i8>), !cir.ptr<!void>
// AFTER-NEXT: cir.br [[BB_END]]([[IN_REG_OUTPUT]] : !cir.ptr<!void>)
// LLVM-NEXT: br label %[[BB_END]],
Expand All @@ -94,14 +95,14 @@ int f1(int n, ...) {
// LLVM: [[BB_ON_STACK]]: ; preds = %[[BB_MAY_REG]], %[[BB_BEGIN]]
// AFTER-NEXT: [[STACK_P:%.*]] = cir.get_member [[VARLIST]][0] {name = "stack"} : !cir.ptr<!ty_22__va_list22> -> !cir.ptr<!cir.ptr<!void>>
// LLVM-NEXT: [[STACK_P:%.*]] = getelementptr %struct.__va_list, ptr [[VARLIST]], i32 0, i32 0,
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : cir.ptr <!cir.ptr<!void>>, !cir.ptr<!void>
// AFTER-NEXT: [[STACK_V:%.*]] = cir.load [[STACK_P]] : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void>
// LLVM-NEXT: [[STACK_V]] = load ptr, ptr [[STACK_P]], align 8,
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const(#cir.int<8> : !u64i) : !u64i
// AFTER-NEXT: [[EIGHT_IN_PTR_ARITH:%.*]] = cir.const #cir.int<8> : !u64i
// AFTER-NEXT: [[TMP4:%.*]] = cir.cast(bitcast, [[STACK_V]] : !cir.ptr<!void>), !cir.ptr<i8>
// AFTER-NEXT: [[TMP5:%.*]] = cir.ptr_stride([[TMP4]] : !cir.ptr<i8>, [[EIGHT_IN_PTR_ARITH]] : !u64i), !cir.ptr<i8>
// LLVM-NEXT: [[NEW_STACK_V:%.*]] = getelementptr i8, ptr [[STACK_V]], i32 8,
// AFTER-NEXT: [[NEW_STACK_V:%.*]] = cir.cast(bitcast, [[TMP5]] : !cir.ptr<i8>), !cir.ptr<!void>
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, cir.ptr <!cir.ptr<!void>>
// AFTER-NEXT: cir.store [[NEW_STACK_V]], [[STACK_P]] : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>
// LLVM-NEXT: store ptr [[NEW_STACK_V]], ptr [[STACK_P]], align 8,
// AFTER-NEXT: cir.br [[BB_END]]([[STACK_V]] : !cir.ptr<!void>)
// LLVM-NEXT: br label %[[BB_END]],

0 comments on commit 168ca49

Please sign in to comment.