Skip to content

Commit 012486e

Browse files
committed
[CIR] Remove redundant result type of cir.const operation
1 parent d156fd3 commit 012486e

File tree

133 files changed

+620
-640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+620
-640
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

+22-25
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def PtrStrideOp : CIR_Op<"ptr_stride",
264264
a stride (second operand).
265265

266266
```mlir
267-
%3 = cir.const(0 : i32) : i32
267+
%3 = cir.const 0 : i32
268268
%4 = cir.ptr_stride(%2 : !cir.ptr<i32>, %3 : i32), !cir.ptr<i32>
269269
```
270270
}];
@@ -293,7 +293,7 @@ def PtrStrideOp : CIR_Op<"ptr_stride",
293293
//===----------------------------------------------------------------------===//
294294

295295
def ConstantOp : CIR_Op<"const",
296-
[ConstantLike, Pure]> {
296+
[ConstantLike, Pure, AllTypesMatch<["value", "res"]>]> {
297297
// FIXME: Use SameOperandsAndResultType or similar and prevent eye bleeding
298298
// type repetition in the assembly form.
299299

@@ -303,9 +303,9 @@ def ConstantOp : CIR_Op<"const",
303303
attached to the operation as an attribute.
304304

305305
```mlir
306-
%0 = cir.const(42 : i32) : i32
307-
%1 = cir.const(4.2 : f32) : f32
308-
%2 = cir.const(nullptr : !cir.ptr<i32>) : !cir.ptr<i32>
306+
%0 = cir.const 42 : i32
307+
%1 = cir.const 4.2 : f32
308+
%2 = cir.const nullptr : !cir.ptr<i32>
309309
```
310310
}];
311311

@@ -315,9 +315,7 @@ def ConstantOp : CIR_Op<"const",
315315
// The constant operation returns a single value of CIR_AnyType.
316316
let results = (outs CIR_AnyType:$res);
317317

318-
let assemblyFormat = [{
319-
`(` custom<ConstantValue>($value) `)` attr-dict `:` type($res)
320-
}];
318+
let assemblyFormat = "attr-dict $value";
321319

322320
let hasVerifier = 1;
323321

@@ -1111,13 +1109,13 @@ def BitClrsbOp : CIR_BitOp<"bit.clrsb", AnyTypeOf<[SInt32, SInt64]>> {
11111109
!s32i = !cir.int<s, 32>
11121110

11131111
// %0 = 0xDEADBEEF, 0b1101_1110_1010_1101_1011_1110_1110_1111
1114-
%0 = cir.const(#cir.int<3735928559> : !s32i) : !s32i
1112+
%0 = cir.const #cir.int<3735928559> : !s32i
11151113
// %1 will be 1 because there is 1 bit following the most significant bit
11161114
// that is identical to it.
11171115
%1 = cir.bit.clrsb(%0 : !s32i) : !s32i
11181116

11191117
// %2 = 1, 0b0000_0000_0000_0000_0000_0000_0000_0001
1120-
%2 = cir.const(#cir.int<1> : !s32i) : !s32i
1118+
%2 = cir.const #cir.int<1> : !s32i
11211119
// %3 will be 30
11221120
%3 = cir.bit.clrsb(%2 : !s32i) : !s32i
11231121
```
@@ -1142,7 +1140,7 @@ def BitClzOp : CIR_BitOp<"bit.clz", AnyTypeOf<[UInt16, UInt32, UInt64]>> {
11421140
!u32i = !cir.int<u, 32>
11431141

11441142
// %0 = 0b0000_0000_0000_0000_0000_0000_0000_1000
1145-
%0 = cir.const(#cir.int<8> : !u32i) : !u32i
1143+
%0 = cir.const #cir.int<8> : !u32i
11461144
// %1 will be 28
11471145
%1 = cir.bit.clz(%0 : !u32i) : !s32i
11481146
```
@@ -1167,7 +1165,7 @@ def BitCtzOp : CIR_BitOp<"bit.ctz", AnyTypeOf<[UInt16, UInt32, UInt64]>> {
11671165
!u32i = !cir.int<u, 32>
11681166

11691167
// %0 = 0b1000
1170-
%0 = cir.const(#cir.int<8> : !u32i) : !u32i
1168+
%0 = cir.const #cir.int<8> : !u32i
11711169
// %1 will be 3
11721170
%1 = cir.bit.ctz(%0 : !u32i) : !s32i
11731171
```
@@ -1190,7 +1188,7 @@ def BitFfsOp : CIR_BitOp<"bit.ffs", AnyTypeOf<[SInt32, SInt64]>> {
11901188
!s32i = !cir.int<s, 32>
11911189

11921190
// %0 = 0x0010_1000
1193-
%0 = cir.const(#cir.int<40> : !s32i) : !s32i
1191+
%0 = cir.const #cir.int<40> : !s32i
11941192
// #1 will be 4 since the 4th least significant bit is 1.
11951193
%1 = cir.bit.ffs(%0 : !s32i) : !s32i
11961194
```
@@ -1212,9 +1210,9 @@ def BitParityOp : CIR_BitOp<"bit.parity", AnyTypeOf<[UInt32, UInt64]>> {
12121210
!u32i = !cir.int<u, 32>
12131211

12141212
// %0 = 0x0110_1000
1215-
%0 = cir.const(#cir.int<104> : !u32i) : !s32i
1213+
%0 = cir.const #cir.int<104> : !u32i
12161214
// %1 will be 1 since there are 3 1-bits in %0
1217-
%1 = cir.bit.parity(%0 : !u32i) : !s32i
1215+
%1 = cir.bit.parity(%0 : !u32i) : !u32i
12181216
```
12191217
}];
12201218
}
@@ -1230,13 +1228,12 @@ def BitPopcountOp
12301228
Example:
12311229

12321230
```mlir
1233-
!s32i = !cir.int<s, 32>
12341231
!u32i = !cir.int<u, 32>
12351232

12361233
// %0 = 0x0110_1000
1237-
%0 = cir.const(#cir.int<104> : !u32i) : !s32i
1234+
%0 = cir.const #cir.int<104> : !u32i
12381235
// %1 will be 3 since there are 3 1-bits in %0
1239-
%1 = cir.bit.popcount(%0 : !u32i) : !s32i
1236+
%1 = cir.bit.popcount(%0 : !u32i) : !u32i
12401237
```
12411238
}];
12421239
}
@@ -1260,7 +1257,7 @@ def ByteswapOp : CIR_Op<"bswap", [Pure, SameOperandsAndResultType]> {
12601257
!u32i = !cir.int<u, 32>
12611258

12621259
// %0 = 0x12345678
1263-
%0 = cir.const(#cir.int<305419896> : !u32i) : !u32i
1260+
%0 = cir.const #cir.int<305419896> : !u32i
12641261

12651262
// %1 should be 0x78563412
12661263
%1 = cir.bswap(%0 : !u32i) : !u32i
@@ -1302,12 +1299,12 @@ def CmpThreeWayOp : CIR_Op<"cmp3way", [Pure, SameTypeOperands]> {
13021299
#cmp3way_strong = #cmp3way_info<strong, lt = -1, eq = 0, gt = 1>
13031300
#cmp3way_partial = #cmp3way_info<strong, lt = -1, eq = 0, gt = 1, unordered = 2>
13041301

1305-
%0 = cir.const(#cir.int<0> : !s32i) : !s32i
1306-
%1 = cir.const(#cir.int<1> : !s32i) : !s32i
1302+
%0 = cir.const #cir.int<0> : !s32i
1303+
%1 = cir.const #cir.int<1> : !s32i
13071304
%2 = cir.cmp3way(%0 : !s32i, %1, #cmp3way_strong) : !s8i
13081305

1309-
%3 = cir.const(#cir.fp<0.0> : !cir.float) : !cir.float
1310-
%4 = cir.const(#cir.fp<1.0> : !cir.float) : !cir.float
1306+
%3 = cir.const #cir.fp<0.0> : !cir.float
1307+
%4 = cir.const #cir.fp<1.0> : !cir.float
13111308
%5 = cir.cmp3way(%3 : !cir.float, %4, #cmp3way_partial) : !s8i
13121309
```
13131310
}];
@@ -1961,7 +1958,7 @@ def SetBitfieldOp : CIR_Op<"set_bitfield"> {
19611958
!struct_type = !cir.struct<struct "S" {!cir.int<u, 32>, !cir.int<u, 32>, !cir.int<u, 16>} #cir.record.decl.ast>
19621959
#bfi_d = #cir.bitfield_info<name = "d", storage_type = !u32i, size = 2, offset = 17, is_signed = true>
19631960

1964-
%1 = cir.const(#cir.int<3> : !s32i) : !s32i
1961+
%1 = cir.const #cir.int<3> : !s32i
19651962
%2 = cir.load %0 : !cir.ptr<!cir.ptr<!struct_type>>, !cir.ptr<!struct_type>
19661963
%3 = cir.get_member %2[1] {name = "d"} : !cir.ptr<!struct_type> -> !cir.ptr<!u32i>
19671964
%4 = cir.set_bitfield(#bfi_d, %3 : !cir.ptr<!u32i>, %1 : !s32i) -> !s32i
@@ -3045,7 +3042,7 @@ def MemCpyOp : CIR_Op<"libc.memcpy"> {
30453042

30463043
```mlir
30473044
// Copying 2 bytes from one array to a struct:
3048-
%2 = cir.const(#cir.int<2> : !u32i) : !u32i
3045+
%2 = cir.const #cir.int<2> : !u32i
30493046
cir.libc.memcpy %2 bytes from %arr to %struct : !cir.ptr<!arr> -> !cir.ptr<!struct>
30503047
```
30513048
}];

clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ void AggExprEmitter::buildArrayInit(Address DestPtr, mlir::cir::ArrayType AType,
464464
mlir::Value element = begin;
465465

466466
// Don't build the 'one' before the cycle to avoid
467-
// emmiting the redundant cir.const(1) instrs.
467+
// emmiting the redundant `cir.const 1` instrs.
468468
mlir::Value one;
469469

470470
// Emit the explicit initializers.

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

+12-17
Original file line numberDiff line numberDiff line change
@@ -364,23 +364,6 @@ LogicalResult ConstantOp::verify() {
364364
return checkConstantTypes(getOperation(), getType(), getValue());
365365
}
366366

367-
static ParseResult parseConstantValue(OpAsmParser &parser,
368-
mlir::Attribute &valueAttr) {
369-
NamedAttrList attr;
370-
return parser.parseAttribute(valueAttr, "value", attr);
371-
}
372-
373-
// FIXME: create a CIRConstAttr and hide this away for both global
374-
// initialization and cir.const operation.
375-
static void printConstant(OpAsmPrinter &p, Attribute value) {
376-
p.printAttribute(value);
377-
}
378-
379-
static void printConstantValue(OpAsmPrinter &p, cir::ConstantOp op,
380-
Attribute value) {
381-
printConstant(p, value);
382-
}
383-
384367
OpFoldResult ConstantOp::fold(FoldAdaptor /*adaptor*/) { return getValue(); }
385368

386369
//===----------------------------------------------------------------------===//
@@ -1487,6 +1470,18 @@ ::llvm::SmallVector<Region *> ForOp::getLoopRegions() { return {&getBody()}; }
14871470
// GlobalOp
14881471
//===----------------------------------------------------------------------===//
14891472

1473+
static ParseResult parseConstantValue(OpAsmParser &parser,
1474+
mlir::Attribute &valueAttr) {
1475+
NamedAttrList attr;
1476+
return parser.parseAttribute(valueAttr, "value", attr);
1477+
}
1478+
1479+
// FIXME: create a CIRConstAttr and hide this away for both global
1480+
// initialization and cir.const operation.
1481+
static void printConstant(OpAsmPrinter &p, Attribute value) {
1482+
p.printAttribute(value);
1483+
}
1484+
14901485
static void printGlobalOpTypeAndInitialValue(OpAsmPrinter &p, GlobalOp op,
14911486
TypeAttr type, Attribute initAttr,
14921487
mlir::Region &ctorRegion,

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3178,10 +3178,10 @@ static void buildCtorDtorList(
31783178
// cir.func @foo(%arg0: !s32i) -> !s32i {
31793179
// %4 = cir.cast(int_to_bool, %arg0 : !s32i), !cir.bool
31803180
// cir.if %4 {
3181-
// %5 = cir.const(#cir.int<1> : !s32i) : !s32i
3181+
// %5 = cir.const #cir.int<1> : !s32i
31823182
// cir.return %5 : !s32i
31833183
// } else {
3184-
// %5 = cir.const(#cir.int<0> : !s32i) : !s32i
3184+
// %5 = cir.const #cir.int<0> : !s32i
31853185
// cir.return %5 : !s32i
31863186
// }
31873187
// cir.return %arg0 : !s32i

clang/test/CIR/CodeGen/OpenMP/parallel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ void omp_parallel_2() {
1818
// CHECK: omp.parallel {
1919
// CHECK-NEXT: cir.scope {
2020
// CHECK-NEXT: %[[XVarDecl:.+]] = {{.*}} ["x", init]
21-
// CHECK-NEXT: %[[C1:.+]] = cir.const(#cir.int<1> : !s32i)
21+
// CHECK-NEXT: %[[C1:.+]] = cir.const #cir.int<1> : !s32i
2222
// CHECK-NEXT: cir.store %[[C1]], %[[XVarDecl]]
2323
// CHECK-NEXT: %[[XVal:.+]] = cir.load %[[XVarDecl]]
24-
// CHECK-NEXT: %[[COne:.+]] = cir.const(#cir.int<1> : !s32i)
24+
// CHECK-NEXT: %[[COne:.+]] = cir.const #cir.int<1> : !s32i
2525
// CHECK-NEXT: %[[BinOpVal:.+]] = cir.binop(add, %[[XVal]], %[[COne]])
2626
// CHECK-NEXT: cir.store %[[BinOpVal]], %[[YVarDecl]]
2727
// CHECK-NEXT: }

clang/test/CIR/CodeGen/String.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ void test() {
2222
// CHECK-NEXT: cir.store %arg0, %0
2323
// CHECK-NEXT: %1 = cir.load %0
2424
// CHECK-NEXT: %2 = cir.get_member %1[0] {name = "storage"}
25-
// CHECK-NEXT: %3 = cir.const(#cir.ptr<null> : !cir.ptr<!s8i>) : !cir.ptr<!s8i>
25+
// CHECK-NEXT: %3 = cir.const #cir.ptr<null> : !cir.ptr<!s8i>
2626
// CHECK-NEXT: cir.store %3, %2 : !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>>
2727
// CHECK-NEXT: %4 = cir.get_member %1[1] {name = "size"} : !cir.ptr<!ty_22String22> -> !cir.ptr<!s64i>
28-
// CHECK-NEXT: %5 = cir.const(#cir.int<0> : !s32i) : !s32i
28+
// CHECK-NEXT: %5 = cir.const #cir.int<0> : !s32i
2929
// CHECK-NEXT: %6 = cir.cast(integral, %5 : !s32i), !s64i
3030
// CHECK-NEXT: cir.store %6, %4 : !s64i, !cir.ptr<!s64i>
3131
// CHECK-NEXT: cir.return
@@ -37,7 +37,7 @@ void test() {
3737
// CHECK-NEXT: cir.store %arg1, %1
3838
// CHECK-NEXT: %2 = cir.load %0
3939
// CHECK-NEXT: %3 = cir.get_member %2[0] {name = "storage"}
40-
// CHECK-NEXT: %4 = cir.const(#cir.ptr<null> : !cir.ptr<!s8i>)
40+
// CHECK-NEXT: %4 = cir.const #cir.ptr<null> : !cir.ptr<!s8i>
4141
// CHECK-NEXT: cir.store %4, %3
4242
// CHECK-NEXT: %5 = cir.get_member %2[1] {name = "size"} : !cir.ptr<!ty_22String22> -> !cir.ptr<!s64i>
4343
// CHECK-NEXT: %6 = cir.load %1 : !cir.ptr<!s32i>, !s32i
@@ -53,7 +53,7 @@ void test() {
5353
// CHECK-NEXT: cir.store %arg1, %1 : !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>>
5454
// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr<!cir.ptr<!ty_22String22>>, !cir.ptr<!ty_22String22>
5555
// CHECK-NEXT: %3 = cir.get_member %2[0] {name = "storage"} : !cir.ptr<!ty_22String22> -> !cir.ptr<!cir.ptr<!s8i>>
56-
// CHECK-NEXT: %4 = cir.const(#cir.ptr<null> : !cir.ptr<!s8i>) : !cir.ptr<!s8i>
56+
// CHECK-NEXT: %4 = cir.const #cir.ptr<null> : !cir.ptr<!s8i>
5757
// CHECK-NEXT: cir.store %4, %3 : !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>>
5858
// CHECK-NEXT: cir.return
5959

clang/test/CIR/CodeGen/agg-copy.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ typedef struct {
1515
// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr<!ty_22A22>, !cir.ptr<!cir.ptr<!ty_22A22>>
1616
// CHECK: cir.store %arg1, [[TMP1]] : !cir.ptr<!ty_22A22>, !cir.ptr<!cir.ptr<!ty_22A22>>
1717
// CHECK: [[TMP2:%.*]] = cir.load [[TMP0]] : !cir.ptr<!cir.ptr<!ty_22A22>>, !cir.ptr<!ty_22A22>
18-
// CHECK: [[TMP3:%.*]] = cir.const(#cir.int<1> : !s32i) : !s32i
18+
// CHECK: [[TMP3:%.*]] = cir.const #cir.int<1> : !s32i
1919
// CHECK: [[TMP4:%.*]] = cir.ptr_stride([[TMP2]] : !cir.ptr<!ty_22A22>, [[TMP3]] : !s32i), !cir.ptr<!ty_22A22>
2020
// CHECK: [[TMP5:%.*]] = cir.load [[TMP1]] : !cir.ptr<!cir.ptr<!ty_22A22>>, !cir.ptr<!ty_22A22>
21-
// CHECK: [[TMP6:%.*]] = cir.const(#cir.int<1> : !s32i) : !s32i
21+
// CHECK: [[TMP6:%.*]] = cir.const #cir.int<1> : !s32i
2222
// CHECK: [[TMP7:%.*]] = cir.ptr_stride([[TMP5]] : !cir.ptr<!ty_22A22>, [[TMP6]] : !s32i), !cir.ptr<!ty_22A22>
2323
// CHECK: cir.copy [[TMP7]] to [[TMP4]] : !cir.ptr<!ty_22A22>
2424
void foo1(A* a1, A* a2) {
@@ -68,7 +68,7 @@ A create() { A a; return a; }
6868
// CHECK: [[TMP1:%.*]] = cir.alloca !ty_22A22, !cir.ptr<!ty_22A22>, ["tmp"] {alignment = 4 : i64}
6969
// CHECK: [[TMP2:%.*]] = cir.call @create() : () -> !ty_22A22
7070
// CHECK: cir.store [[TMP2]], [[TMP1]] : !ty_22A22, !cir.ptr<!ty_22A22>
71-
// CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr<!ty_22A22>
71+
// CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr<!ty_22A22>
7272
void foo5() {
7373
A a;
7474
a = create();

clang/test/CIR/CodeGen/agg-init.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ void use() { yop{}; }
1919
// CHECK: cir.func @_Z3usev()
2020
// CHECK: %0 = cir.alloca !ty_22yep_22, !cir.ptr<!ty_22yep_22>, ["agg.tmp.ensured"] {alignment = 4 : i64}
2121
// CHECK: %1 = cir.get_member %0[0] {name = "Status"} : !cir.ptr<!ty_22yep_22> -> !cir.ptr<!u32i>
22-
// CHECK: %2 = cir.const(#cir.int<0> : !u32i) : !u32i
22+
// CHECK: %2 = cir.const #cir.int<0> : !u32i
2323
// CHECK: cir.store %2, %1 : !u32i, !cir.ptr<!u32i>
2424
// CHECK: %3 = cir.get_member %0[1] {name = "HC"} : !cir.ptr<!ty_22yep_22> -> !cir.ptr<!u32i>
25-
// CHECK: %4 = cir.const(#cir.int<0> : !u32i) : !u32i
25+
// CHECK: %4 = cir.const #cir.int<0> : !u32i
2626
// CHECK: cir.store %4, %3 : !u32i, !cir.ptr<!u32i>
2727
// CHECK: cir.return
2828
// CHECK: }
@@ -49,14 +49,14 @@ void yo() {
4949
// CHECK: cir.func @_Z2yov()
5050
// CHECK: %0 = cir.alloca !ty_22Yo22, !cir.ptr<!ty_22Yo22>, ["ext"] {alignment = 8 : i64}
5151
// CHECK: %1 = cir.alloca !ty_22Yo22, !cir.ptr<!ty_22Yo22>, ["ext2", init] {alignment = 8 : i64}
52-
// CHECK: %2 = cir.const(#cir.const_struct<{#cir.int<1000070000> : !u32i, #cir.ptr<null> : !cir.ptr<!void>, #cir.int<0> : !u64i}> : !ty_22Yo22) : !ty_22Yo22
52+
// CHECK: %2 = cir.const #cir.const_struct<{#cir.int<1000070000> : !u32i, #cir.ptr<null> : !cir.ptr<!void>, #cir.int<0> : !u64i}> : !ty_22Yo22
5353
// CHECK: cir.store %2, %0 : !ty_22Yo22, !cir.ptr<!ty_22Yo22>
5454
// CHECK: %3 = cir.get_member %1[0] {name = "type"} : !cir.ptr<!ty_22Yo22> -> !cir.ptr<!u32i>
55-
// CHECK: %4 = cir.const(#cir.int<1000066001> : !u32i) : !u32i
55+
// CHECK: %4 = cir.const #cir.int<1000066001> : !u32i
5656
// CHECK: cir.store %4, %3 : !u32i, !cir.ptr<!u32i>
5757
// CHECK: %5 = cir.get_member %1[1] {name = "next"} : !cir.ptr<!ty_22Yo22> -> !cir.ptr<!cir.ptr<!void>>
5858
// CHECK: %6 = cir.cast(bitcast, %0 : !cir.ptr<!ty_22Yo22>), !cir.ptr<!void>
5959
// CHECK: cir.store %6, %5 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>
6060
// CHECK: %7 = cir.get_member %1[2] {name = "createFlags"} : !cir.ptr<!ty_22Yo22> -> !cir.ptr<!u64i>
61-
// CHECK: %8 = cir.const(#cir.int<0> : !u64i) : !u64i
61+
// CHECK: %8 = cir.const #cir.int<0> : !u64i
6262
// CHECK: cir.store %8, %7 : !u64i, !cir.ptr<!u64i>

clang/test/CIR/CodeGen/array-init-destroy.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ void x() {
3636

3737
// AFTER: cir.func @_Z1xv()
3838
// AFTER: %[[ArrayAddr0:.*]] = cir.alloca !cir.array<!ty_22xpto22 x 2>
39-
// AFTER: %[[ConstTwo:.*]] = cir.const(#cir.int<2> : !u64i) : !u64i
39+
// AFTER: %[[ConstTwo:.*]] = cir.const #cir.int<2> : !u64i
4040
// AFTER: %[[ArrayBegin:.*]] = cir.cast(array_to_ptrdecay, %[[ArrayAddr0]] : !cir.ptr<!cir.array<!ty_22xpto22 x 2>>), !cir.ptr<!ty_22xpto22>
4141
// AFTER: %[[ArrayPastEnd:.*]] = cir.ptr_stride(%[[ArrayBegin]] : !cir.ptr<!ty_22xpto22>, %[[ConstTwo]] : !u64i), !cir.ptr<!ty_22xpto22>
4242
// AFTER: %[[TmpIdx:.*]] = cir.alloca !cir.ptr<!ty_22xpto22>, !cir.ptr<!cir.ptr<!ty_22xpto22>>, ["__array_idx"] {alignment = 1 : i64}
4343
// AFTER: cir.store %[[ArrayBegin]], %[[TmpIdx]] : !cir.ptr<!ty_22xpto22>, !cir.ptr<!cir.ptr<!ty_22xpto22>>
4444
// AFTER: cir.do {
4545
// AFTER: %[[ArrayElt:.*]] = cir.load %[[TmpIdx]] : !cir.ptr<!cir.ptr<!ty_22xpto22>>, !cir.ptr<!ty_22xpto22>
46-
// AFTER: %[[ConstOne:.*]] = cir.const(#cir.int<1> : !u64i) : !u64i
46+
// AFTER: %[[ConstOne:.*]] = cir.const #cir.int<1> : !u64i
4747
// AFTER: cir.call @_ZN4xptoC1Ev(%[[ArrayElt]]) : (!cir.ptr<!ty_22xpto22>) -> ()
4848
// AFTER: %[[NextElt:.*]] = cir.ptr_stride(%[[ArrayElt]] : !cir.ptr<!ty_22xpto22>, %[[ConstOne]] : !u64i), !cir.ptr<!ty_22xpto22>
4949
// AFTER: cir.store %[[NextElt]], %[[TmpIdx]] : !cir.ptr<!ty_22xpto22>, !cir.ptr<!cir.ptr<!ty_22xpto22>>

0 commit comments

Comments
 (0)