Skip to content

Commit fb2921b

Browse files
committed
Actually, zero dimensions are allowed
1 parent 496a840 commit fb2921b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct DimOpInterface
5151
auto dimOp = cast<DimOp>(op);
5252
assert(value == dimOp.getResult() && "invalid value");
5353

54-
cstr.bound(value) > 0;
54+
cstr.bound(value) >= 0;
5555
auto constIndex = dimOp.getConstantIndex();
5656
if (!constIndex.has_value())
5757
return;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct DimOpInterface
3838
auto dimOp = cast<DimOp>(op);
3939
assert(value == dimOp.getResult() && "invalid value");
4040

41-
cstr.bound(value) > 0;
41+
cstr.bound(value) >= 0;
4242
auto constIndex = dimOp.getConstantIndex();
4343
if (!constIndex.has_value())
4444
return;

mlir/test/Dialect/MemRef/value-bounds-op-interface-impl.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func.func @memref_dim_all_positive(%m: memref<?xf32>, %x: index) {
5757
%c0 = arith.constant 0 : index
5858
%0 = memref.dim %m, %x : memref<?xf32>
5959
// expected-remark @below{{true}}
60-
"test.compare"(%0, %c0) {cmp = "GT"} : (index, index) -> ()
60+
"test.compare"(%0, %c0) {cmp = "GE"} : (index, index) -> ()
6161
return
6262
}
6363

mlir/test/Dialect/Tensor/value-bounds-op-interface-impl.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func.func @dim_all_positive(%t: tensor<?xf32>, %x: index) {
4949
%c0 = arith.constant 0 : index
5050
%0 = tensor.dim %t, %x : tensor<?xf32>
5151
// expected-remark @below{{true}}
52-
"test.compare"(%0, %c0) {cmp = "GT" } : (index, index) -> ()
52+
"test.compare"(%0, %c0) {cmp = "GE" } : (index, index) -> ()
5353
return
5454
}
5555

0 commit comments

Comments
 (0)