Skip to content

Commit 4ffe6bd

Browse files
committed
[mlir] NFC formatting cleanup.
1 parent 655e08c commit 4ffe6bd

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ def Shape_AnyOp : Shape_Op<"any", [Commutative, NoSideEffect]> {
449449

450450
Example:
451451
```mlir
452-
%s0 = shape.any [2,?], [?,3] // [2,3]
453-
%s1 = shape.any [?,?], [1,2] // [1,2]
452+
%s0 = shape.any [2,?], [?,3] // [2,3]
453+
%s1 = shape.any [?,?], [1,2] // [1,2]
454454
```
455455
}];
456456

@@ -475,11 +475,11 @@ def Shape_AssumingAllOp : Shape_Op<"assuming_all", [Commutative, NoSideEffect]>
475475

476476
Example:
477477
```mlir
478-
%w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing
479-
%w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure
480-
%w2 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing
481-
%wf = shape.assuming_all %w0, %w1 // Failure
482-
%wt = shape.assuming_all %w0, %w2 // Passing
478+
%w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing
479+
%w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure
480+
%w2 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing
481+
%wf = shape.assuming_all %w0, %w1 // Failure
482+
%wt = shape.assuming_all %w0, %w2 // Passing
483483
```
484484
}];
485485

@@ -543,8 +543,8 @@ def Shape_CstrBroadcastableOp : Shape_Op<"cstr_broadcastable", [Commutative]> {
543543

544544
Example:
545545
```mlir
546-
%w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing
547-
%w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure
546+
%w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing
547+
%w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure
548548
```
549549
}];
550550

@@ -566,8 +566,8 @@ def Shape_CstrEqOp : Shape_Op<"cstr_eq", [Commutative]> {
566566

567567
Example:
568568
```mlir
569-
%w0 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing
570-
%w1 = shape.cstr_eq [2,2], [1,2] // Failure
569+
%w0 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing
570+
%w1 = shape.cstr_eq [2,2], [1,2] // Failure
571571
```
572572
}];
573573
let arguments = (ins Variadic<Shape_ShapeType>:$inputs);

mlir/lib/Dialect/Shape/IR/Shape.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@ ShapeDialect::ShapeDialect(MLIRContext *context)
3939
Operation *ShapeDialect::materializeConstant(OpBuilder &builder,
4040
Attribute value, Type type,
4141
Location loc) {
42-
if (auto shapeType = type.dyn_cast<ShapeType>()) {
42+
if (auto shapeType = type.dyn_cast<ShapeType>())
4343
return builder.create<ConstShapeOp>(loc, type,
4444
value.cast<DenseIntElementsAttr>());
45-
}
46-
if (auto sizeType = type.dyn_cast<SizeType>()) {
45+
if (auto sizeType = type.dyn_cast<SizeType>())
4746
return builder.create<ConstSizeOp>(loc, type, value.cast<IntegerAttr>());
48-
}
49-
if (auto witnessType = type.dyn_cast<WitnessType>()) {
47+
if (auto witnessType = type.dyn_cast<WitnessType>())
5048
return builder.create<ConstWitnessOp>(loc, type, value.cast<BoolAttr>());
51-
}
5249
return nullptr;
5350
}
5451

0 commit comments

Comments
 (0)