diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp --- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp +++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp @@ -1189,7 +1189,7 @@ if (positionAttr.size() > static_cast(getSourceVectorType().getRank())) return emitOpError( - "expected position attribute of rank smaller than vector rank"); + "expected position attribute of rank no greater than vector rank"); for (const auto &en : llvm::enumerate(positionAttr)) { auto attr = llvm::dyn_cast(en.value()); if (!attr || attr.getInt() < 0 || @@ -2328,7 +2328,7 @@ auto destVectorType = getDestVectorType(); if (positionAttr.size() > static_cast(destVectorType.getRank())) return emitOpError( - "expected position attribute of rank smaller than dest vector rank"); + "expected position attribute of rank no greater than dest vector rank"); auto srcVectorType = llvm::dyn_cast(getSourceType()); if (srcVectorType && (static_cast(srcVectorType.getRank()) + positionAttr.size() != @@ -2489,7 +2489,7 @@ StringRef attrName) { if (arrayAttr.size() > shape.size()) return op.emitOpError("expected ") - << attrName << " attribute of rank smaller than vector rank"; + << attrName << " attribute of rank no greater than vector rank"; return success(); } @@ -2580,7 +2580,7 @@ return emitOpError("expected strides of same size as source vector rank"); if (sourceVectorType.getRank() > destVectorType.getRank()) return emitOpError( - "expected source rank to be smaller than destination rank"); + "expected source rank to be no greater than destination rank"); auto sourceShape = sourceVectorType.getShape(); auto destShape = destVectorType.getShape(); diff --git a/mlir/test/Dialect/Vector/invalid.mlir b/mlir/test/Dialect/Vector/invalid.mlir --- a/mlir/test/Dialect/Vector/invalid.mlir +++ b/mlir/test/Dialect/Vector/invalid.mlir @@ -125,14 +125,14 @@ // ----- func.func @extract_position_rank_overflow(%arg0: vector<4x8x16xf32>) { - // expected-error@+1 {{expected position attribute of rank smaller than vector}} + // expected-error@+1 {{expected position attribute of rank no greater than vector rank}} %1 = vector.extract %arg0[0, 0, 0, 0] : vector<4x8x16xf32> } // ----- func.func @extract_position_rank_overflow_generic(%arg0: vector<4x8x16xf32>) { - // expected-error@+1 {{expected position attribute of rank smaller than vector}} + // expected-error@+1 {{expected position attribute of rank no greater than vector rank}} %1 = "vector.extract" (%arg0) { position = [0, 0, 0, 0] } : (vector<4x8x16xf32>) -> (vector<16xf32>) } @@ -192,7 +192,7 @@ // ----- func.func @insert_vector_type(%a: f32, %b: vector<4x8x16xf32>) { - // expected-error@+1 {{expected position attribute of rank smaller than dest vector rank}} + // expected-error@+1 {{expected position attribute of rank no greater than dest vector rank}} %1 = vector.insert %a, %b[3, 3, 3, 3, 3, 3] : f32 into vector<4x8x16xf32> } @@ -566,7 +566,7 @@ // ----- func.func @insert_strided_slice(%a: vector<4x4xf32>, %b: vector<4x8x16xf32>) { - // expected-error@+1 {{expected source rank to be smaller than destination rank}} + // expected-error@+1 {{expected source rank to be no greater than destination rank}} %1 = vector.insert_strided_slice %b, %a {offsets = [2, 2], strides = [1, 1, 1]} : vector<4x8x16xf32> into vector<4x4xf32> } @@ -601,14 +601,14 @@ // ----- func.func @extract_strided_slice(%arg0: vector<4x8x16xf32>) { - // expected-error@+1 {{expected offsets attribute of rank smaller than vector rank}} + // expected-error@+1 {{expected offsets attribute of rank no greater than vector rank}} %1 = vector.extract_strided_slice %arg0 {offsets = [2, 2, 2, 2], sizes = [2, 2, 2, 2], strides = [1, 1, 1, 1]} : vector<4x8x16xf32> to vector<2x2x16xf32> } // ----- func.func @extract_strided_slice(%arg0: vector<4x8x16xf32>) { - // expected-error@+1 {{expected offsets attribute of rank smaller than vector rank}} + // expected-error@+1 {{expected offsets attribute of rank no greater than vector rank}} %1 = vector.extract_strided_slice %arg0 {offsets = [2, 2, 2, 2], sizes = [2, 2, 2, 2], strides = [1, 1, 1, 1]} : vector<4x8x16xf32> to vector<2x2x16xf32> }