From e5a4d0f1498c51858ee9e6682b235389f500ed15 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Sun, 21 Nov 2021 15:06:08 -0800 Subject: [PATCH] [mlir] Fix unused function warning (NFC) Delete function no longer needed as all derived classes override printer. --- mlir/include/mlir/Dialect/StandardOps/IR/Ops.td | 8 -------- mlir/lib/Dialect/StandardOps/IR/Ops.cpp | 22 ---------------------- 2 files changed, 30 deletions(-) diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td index 89ee6a0..58c372b 100644 --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -82,10 +82,6 @@ class ArithmeticOp traits = []> : let parser = [{ return impl::parseOneResultSameOperandTypeOp(parser, result); }]; - - let printer = [{ - return printStandardBinaryOp(this->getOperation(), p); - }]; } // Base class for standard binary arithmetic operations. @@ -95,10 +91,6 @@ class ArithmeticBinaryOp traits = []> : let parser = [{ return impl::parseOneResultSameOperandTypeOp(parser, result); }]; - - let printer = [{ - return printStandardBinaryOp(this->getOperation(), p); - }]; } // Base class for standard ternary arithmetic operations. diff --git a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp index 17a69b0..a974a4f 100644 --- a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp +++ b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp @@ -100,28 +100,6 @@ struct StdInlinerInterface : public DialectInlinerInterface { // StandardOpsDialect //===----------------------------------------------------------------------===// -/// A custom binary operation printer that omits the "std." prefix from the -/// operation names. -static void printStandardBinaryOp(Operation *op, OpAsmPrinter &p) { - assert(op->getNumOperands() == 2 && "binary op should have two operands"); - assert(op->getNumResults() == 1 && "binary op should have one result"); - - // If not all the operand and result types are the same, just use the - // generic assembly form to avoid omitting information in printing. - auto resultType = op->getResult(0).getType(); - if (op->getOperand(0).getType() != resultType || - op->getOperand(1).getType() != resultType) { - p.printGenericOp(op); - return; - } - - p << ' ' << op->getOperand(0) << ", " << op->getOperand(1); - p.printOptionalAttrDict(op->getAttrs()); - - // Now we can output only one type for all operands and the result. - p << " : " << op->getResult(0).getType(); -} - void StandardOpsDialect::initialize() { addOperations< #define GET_OP_LIST -- 2.7.4