From 7ce07c649438da249a90a38da87b40da02ce7987 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Fri, 26 Mar 2021 16:03:51 -0700 Subject: [PATCH] [mlir] Remove unneeded ShapeFunctionLibraryTerminatorOp Now that NoTerminator is possible this op can be removed/it was only needed structurally before. NFC. --- mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td | 17 +---------------- mlir/lib/Dialect/Shape/IR/Shape.cpp | 3 --- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td index cc0ff57..34a1227 100644 --- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td +++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td @@ -901,7 +901,7 @@ def Shape_CstrRequireOp : Shape_Op<"cstr_require", []> { def Shape_FunctionLibraryOp : Shape_Op<"function_library", [AffineScope, IsolatedFromAbove, NoRegionArguments, SymbolTable, Symbol, - SingleBlockImplicitTerminator<"ShapeFunctionLibraryTerminatorOp">]> { + NoTerminator, SingleBlock]> { let summary = "Represents shape functions and corresponding ops"; let description = [{ Represents a list of shape functions and the ops whose shape transfer @@ -938,19 +938,4 @@ def Shape_FunctionLibraryOp : Shape_Op<"function_library", let parser = [{ return ::parse$cppClass(parser, result); }]; } -//===----------------------------------------------------------------------===// -// ShapeFunctionLibraryTerminatorOp -//===----------------------------------------------------------------------===// - -def ShapeFunctionLibraryTerminatorOp : Shape_Op<"fn_lib_terminator", - [Terminator, HasParent<"FunctionLibraryOp">]> { - let summary = "A pseudo op that marks the end of a shape function library"; - let description = [{ - `shape_fn_lib_terminator` is a special pseudo terminator operation for the - shape function library. It has no semantic meaning beyond keeping the body - well-formed. - }]; - let assemblyFormat = "attr-dict"; -} - #endif // SHAPE_OPS diff --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp index d2a10a9..a141932 100644 --- a/mlir/lib/Dialect/Shape/IR/Shape.cpp +++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp @@ -744,7 +744,6 @@ OpFoldResult FromExtentsOp::fold(ArrayRef operands) { void FunctionLibraryOp::build(OpBuilder &builder, OperationState &result, StringRef name) { - ensureTerminator(*result.addRegion(), builder, result.location); result.attributes.push_back(builder.getNamedAttr( ::mlir::SymbolTable::getSymbolAttrName(), builder.getStringAttr(name))); } @@ -773,8 +772,6 @@ ParseResult parseFunctionLibraryOp(OpAsmParser &parser, if (parser.parseRegion(*bodyRegion)) return failure(); - FunctionLibraryOp::ensureTerminator(*bodyRegion, parser.getBuilder(), - result.location); if (parser.parseKeyword("mapping")) return failure(); -- 2.7.4