Skip to content

Commit 209dadf

Browse files
committed
[mlir] Fix formatting in Ops.td files (NFC)
MemRefOps.td has some inconsistencies in its formatting of argument lists.
1 parent 67de95b commit 209dadf

File tree

2 files changed

+41
-50
lines changed

2 files changed

+41
-50
lines changed

mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ class AllocLikeOp<string mnemonic,
4848
], traits)> {
4949

5050
let arguments = (ins Variadic<Index>:$dynamicSizes,
51-
// The symbolic operands (the ones in square brackets) bind
52-
// to the symbols of the memref's layout map.
53-
Variadic<Index>:$symbolOperands,
54-
Confined<OptionalAttr<I64Attr>, [IntMinValue<0>]>:$alignment);
51+
// The symbolic operands (the ones in square brackets)
52+
// bind to the symbols of the memref's layout map.
53+
Variadic<Index>:$symbolOperands,
54+
Confined<OptionalAttr<I64Attr>,
55+
[IntMinValue<0>]>:$alignment);
5556
let results = (outs Res<AnyMemRef, "", [MemAlloc<resource>]>:$memref);
5657

5758
let builders = [
@@ -753,11 +754,9 @@ def MemRef_DmaWaitOp : MemRef_Op<"dma_wait"> {
753754
dma_wait %tag[%index], %num_elements : memref<1 x i32, (d0) -> (d0), 2>
754755
```
755756
}];
756-
let arguments = (ins
757-
AnyMemRef:$tagMemRef,
758-
Variadic<Index>:$tagIndices,
759-
Index:$numElements
760-
);
757+
let arguments = (ins AnyMemRef:$tagMemRef,
758+
Variadic<Index>:$tagIndices,
759+
Index:$numElements);
761760
let assemblyFormat = [{
762761
$tagMemRef `[` $tagIndices `]` `,` $numElements attr-dict `:`
763762
type($tagMemRef)
@@ -853,14 +852,12 @@ def MemRef_GlobalOp : MemRef_Op<"global", [Symbol]> {
853852
```
854853
}];
855854

856-
let arguments = (ins
857-
SymbolNameAttr:$sym_name,
858-
OptionalAttr<StrAttr>:$sym_visibility,
859-
MemRefTypeAttr:$type,
860-
OptionalAttr<AnyAttr>:$initial_value,
861-
UnitAttr:$constant,
862-
OptionalAttr<I64Attr>:$alignment
863-
);
855+
let arguments = (ins SymbolNameAttr:$sym_name,
856+
OptionalAttr<StrAttr>:$sym_visibility,
857+
MemRefTypeAttr:$type,
858+
OptionalAttr<AnyAttr>:$initial_value,
859+
UnitAttr:$constant,
860+
OptionalAttr<I64Attr>:$alignment);
864861

865862
let assemblyFormat = [{
866863
($sym_visibility^)?
@@ -978,10 +975,10 @@ def MemRef_PrefetchOp : MemRef_Op<"prefetch"> {
978975
}];
979976

980977
let arguments = (ins AnyMemRef:$memref, Variadic<Index>:$indices,
981-
BoolAttr:$isWrite,
982-
Confined<I32Attr, [IntMinValue<0>,
983-
IntMaxValue<3>]>:$localityHint,
984-
BoolAttr:$isDataCache);
978+
BoolAttr:$isWrite,
979+
Confined<I32Attr, [IntMinValue<0>,
980+
IntMaxValue<3>]>:$localityHint,
981+
BoolAttr:$isDataCache);
985982

986983
let extraClassDeclaration = [{
987984
MemRefType getMemRefType() {
@@ -1024,15 +1021,13 @@ def MemRef_ReinterpretCastOp:
10241021
```
10251022
}];
10261023

1027-
let arguments = (ins
1028-
Arg<AnyRankedOrUnrankedMemRef, "", []>:$source,
1029-
Variadic<Index>:$offsets,
1030-
Variadic<Index>:$sizes,
1031-
Variadic<Index>:$strides,
1032-
I64ArrayAttr:$static_offsets,
1033-
I64ArrayAttr:$static_sizes,
1034-
I64ArrayAttr:$static_strides
1035-
);
1024+
let arguments = (ins Arg<AnyRankedOrUnrankedMemRef, "", []>:$source,
1025+
Variadic<Index>:$offsets,
1026+
Variadic<Index>:$sizes,
1027+
Variadic<Index>:$strides,
1028+
I64ArrayAttr:$static_offsets,
1029+
I64ArrayAttr:$static_sizes,
1030+
I64ArrayAttr:$static_strides);
10361031
let results = (outs AnyMemRef:$result);
10371032

10381033
let assemblyFormat = [{
@@ -1130,10 +1125,8 @@ def MemRef_ReshapeOp: MemRef_Op<"reshape", [
11301125
```
11311126
}];
11321127

1133-
let arguments = (ins
1134-
AnyRankedOrUnrankedMemRef:$source,
1135-
MemRefRankOf<[AnySignlessInteger, Index], [1]>:$shape
1136-
);
1128+
let arguments = (ins AnyRankedOrUnrankedMemRef:$source,
1129+
MemRefRankOf<[AnySignlessInteger, Index], [1]>:$shape);
11371130
let results = (outs AnyRankedOrUnrankedMemRef:$result);
11381131

11391132
let builders = [OpBuilder<
@@ -1504,15 +1497,13 @@ def SubViewOp : BaseOpWithOffsetSizesAndStrides<
15041497
}
15051498
}];
15061499

1507-
let arguments = (ins
1508-
AnyMemRef:$source,
1509-
Variadic<Index>:$offsets,
1510-
Variadic<Index>:$sizes,
1511-
Variadic<Index>:$strides,
1512-
I64ArrayAttr:$static_offsets,
1513-
I64ArrayAttr:$static_sizes,
1514-
I64ArrayAttr:$static_strides
1515-
);
1500+
let arguments = (ins AnyMemRef:$source,
1501+
Variadic<Index>:$offsets,
1502+
Variadic<Index>:$sizes,
1503+
Variadic<Index>:$strides,
1504+
I64ArrayAttr:$static_offsets,
1505+
I64ArrayAttr:$static_sizes,
1506+
I64ArrayAttr:$static_strides);
15161507
let results = (outs AnyMemRef:$result);
15171508

15181509
let assemblyFormat = [{
@@ -1774,8 +1765,8 @@ def MemRef_ViewOp : MemRef_Op<"view", [
17741765
}];
17751766

17761767
let arguments = (ins MemRefRankOf<[I8], [1]>:$source,
1777-
Index:$byte_shift,
1778-
Variadic<Index>:$sizes);
1768+
Index:$byte_shift,
1769+
Variadic<Index>:$sizes);
17791770
let results = (outs AnyMemRef);
17801771

17811772
let extraClassDeclaration = [{

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ def SPV_VectorExtractDynamicOp : SPV_Op<"VectorExtractDynamic", [
211211
);
212212

213213
let verifier = [{ return success(); }];
214-
214+
215215
let assemblyFormat = [{
216-
$vector `[` $index `]` attr-dict `:` type($vector) `,` type($index)
216+
$vector `[` $index `]` attr-dict `:` type($vector) `,` type($index)
217217
}];
218218
}
219219

@@ -249,7 +249,7 @@ def SPV_VectorInsertDynamicOp : SPV_Op<"VectorInsertDynamic", [
249249
<!-- End of AutoGen section -->
250250

251251
```
252-
scalar-type ::= integer-type | float-type | boolean-type
252+
scalar-type ::= integer-type | float-type | boolean-type
253253
vector-insert-dynamic-op ::= `spv.VectorInsertDynamic ` ssa-use `,`
254254
ssa-use `[` ssa-use `]`
255255
`:` `vector<` integer-literal `x` scalar-type `>` `,`
@@ -275,9 +275,9 @@ def SPV_VectorInsertDynamicOp : SPV_Op<"VectorInsertDynamic", [
275275
);
276276

277277
let verifier = [{ return success(); }];
278-
278+
279279
let assemblyFormat = [{
280-
$component `,` $vector `[` $index `]` attr-dict `:` type($vector) `,` type($index)
280+
$component `,` $vector `[` $index `]` attr-dict `:` type($vector) `,` type($index)
281281
}];
282282
}
283283

0 commit comments

Comments
 (0)