diff --git a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td index 05cb41d791d3..882ea33b9c03 100644 --- a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td +++ b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td @@ -782,13 +782,14 @@ def Tensor_CollapseShapeOp : Tensor_ReassociativeReshapeOp<"collapse_shape"> { // PadOp //===----------------------------------------------------------------------===// -def Tensor_PadOp : Tensor_Op<"pad", [AttrSizedOperandSegments, NoSideEffect]> { +def Tensor_PadOp : Tensor_Op<"pad", [AttrSizedOperandSegments, NoSideEffect, + SingleBlockImplicitTerminator<"mlir::tensor::YieldOp">]> { let summary = "tensor pad operation"; let description = [{ `tensor.pad` is an operation that pads the `source` tensor with given `low` and `high` padding config. - The PadTensor operation supports the following arguments: + The PadOp operation supports the following arguments: * source: the "base" tensor on which to pad. * low: A list contains the padding along the start of each diff --git a/mlir/test/Dialect/Tensor/invalid.mlir b/mlir/test/Dialect/Tensor/invalid.mlir index cec4718595a4..7dbf662fd6fe 100644 --- a/mlir/test/Dialect/Tensor/invalid.mlir +++ b/mlir/test/Dialect/Tensor/invalid.mlir @@ -343,15 +343,6 @@ func @pad_number_of_block_args(%arg0: tensor, %arg1: i32) -> tensor, %arg1: i32) -> tensor { - // expected-error @+1 {{op region #0 ('region') failed to verify constraint: region with 1 blocks}} - %0 = tensor.pad %arg0 low[1, 2] high[2, 3] { - } : tensor to tensor - return %0 : tensor -} - -// ----- - func @pad_block_args(%arg0: tensor, %arg1: i32) -> tensor { // expected-error @+1 {{op expected block argument 1 to be an index}} %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {