Skip to content

Commit 847a899

Browse files
committed
let identity versions pass
1 parent e9cdd16 commit 847a899

File tree

4 files changed

+0
-48
lines changed

4 files changed

+0
-48
lines changed

mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,10 +2224,6 @@ LogicalResult ExpandShapeOp::verify() {
22242224
MemRefType srcType = getSrcType();
22252225
MemRefType resultType = getResultType();
22262226

2227-
if (srcType.getRank() >= resultType.getRank())
2228-
return emitOpError("expected rank expansion, but found source rank ")
2229-
<< srcType.getRank() << " >= result rank " << resultType.getRank();
2230-
22312227
// Verify result shape.
22322228
if (failed(verifyCollapsedShape(getOperation(), srcType.getShape(),
22332229
resultType.getShape(),
@@ -2378,10 +2374,6 @@ LogicalResult CollapseShapeOp::verify() {
23782374
MemRefType srcType = getSrcType();
23792375
MemRefType resultType = getResultType();
23802376

2381-
if (srcType.getRank() <= resultType.getRank())
2382-
return emitOpError("expected rank reduction, but found source rank ")
2383-
<< srcType.getRank() << " <= result rank " << resultType.getRank();
2384-
23852377
// Verify result shape.
23862378
if (failed(verifyCollapsedShape(getOperation(), resultType.getShape(),
23872379
srcType.getShape(), getReassociationIndices(),

mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,22 +1656,10 @@ static LogicalResult verifyTensorReshapeOp(TensorReshapeOp op,
16561656
}
16571657

16581658
LogicalResult ExpandShapeOp::verify() {
1659-
auto srcType = getSrcType();
1660-
auto resultType = getResultType();
1661-
if (srcType.getRank() >= resultType.getRank())
1662-
return emitOpError("expected rank expansion, but found source rank ")
1663-
<< srcType.getRank() << " >= result rank " << resultType.getRank();
1664-
16651659
return verifyTensorReshapeOp(*this, getResultType(), getSrcType());
16661660
}
16671661

16681662
LogicalResult CollapseShapeOp::verify() {
1669-
auto srcType = getSrcType();
1670-
auto resultType = getResultType();
1671-
if (srcType.getRank() <= resultType.getRank())
1672-
return emitOpError("expected rank reduction, but found source rank ")
1673-
<< srcType.getRank() << " <= result rank " << resultType.getRank();
1674-
16751663
return verifyTensorReshapeOp(*this, getSrcType(), getResultType());
16761664
}
16771665

mlir/test/Dialect/MemRef/invalid.mlir

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -415,20 +415,6 @@ func.func @collapse_shape_out_of_bounds(%arg0: memref<?x?xf32>) {
415415

416416
// -----
417417

418-
func.func @expand_shape_invalid_ranks(%arg0: memref<?x?xf32>) {
419-
// expected-error @+1 {{op expected rank expansion, but found source rank 2 >= result rank 2}}
420-
%0 = memref.expand_shape %arg0 [[0], [1]] : memref<?x?xf32> into memref<?x?xf32>
421-
}
422-
423-
// -----
424-
425-
func.func @collapse_shape_invalid_ranks(%arg0: memref<?x?xf32>) {
426-
// expected-error @+1 {{op expected rank reduction, but found source rank 2 <= result rank 2}}
427-
%0 = memref.collapse_shape %arg0 [[0], [1]] : memref<?x?xf32> into memref<?x?xf32>
428-
}
429-
430-
// -----
431-
432418
func.func @expand_shape_out_of_bounds(%arg0: memref<?xf32>) {
433419
// expected-error @+1 {{op reassociation index 2 is out of bounds}}
434420
%0 = memref.expand_shape %arg0 [[0, 1, 2]] : memref<?xf32> into memref<4x?xf32>

mlir/test/Dialect/Tensor/invalid.mlir

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -343,20 +343,6 @@ func.func @illegal_collapsing_reshape_mixed_tensor_2(%arg0 : tensor<?x4x5xf32>)
343343

344344
// -----
345345

346-
func.func @expand_shape_invalid_ranks(%arg0: tensor<?x?xf32>) {
347-
// expected-error @+1 {{op expected rank expansion, but found source rank 2 >= result rank 2}}
348-
%0 = tensor.expand_shape %arg0 [[0], [1]] : tensor<?x?xf32> into tensor<?x?xf32>
349-
}
350-
351-
// -----
352-
353-
func.func @collapse_shape_invalid_ranks(%arg0: tensor<?x?xf32>) {
354-
// expected-error @+1 {{op expected rank reduction, but found source rank 2 <= result rank 2}}
355-
%0 = tensor.collapse_shape %arg0 [[0], [1]] : tensor<?x?xf32> into tensor<?x?xf32>
356-
}
357-
358-
// -----
359-
360346
func.func @rank(%0: f32) {
361347
// expected-error@+1 {{'tensor.rank' op operand #0 must be tensor of any type values}}
362348
"tensor.rank"(%0): (f32)->index

0 commit comments

Comments
 (0)