[Mlir-commits] [mlir] e5a4d0f - [mlir] Fix unused function warning (NFC)

Jacques Pienaar llvmlistbot at llvm.org
Sun Nov 21 15:06:53 PST 2021


Author: Jacques Pienaar
Date: 2021-11-21T15:06:08-08:00
New Revision: e5a4d0f1498c51858ee9e6682b235389f500ed15

URL: https://github.com/llvm/llvm-project/commit/e5a4d0f1498c51858ee9e6682b235389f500ed15
DIFF: https://github.com/llvm/llvm-project/commit/e5a4d0f1498c51858ee9e6682b235389f500ed15.diff

LOG: [mlir] Fix unused function warning (NFC)

Delete function no longer needed as all derived classes override
printer.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    mlir/lib/Dialect/StandardOps/IR/Ops.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
index 89ee6a04bf268..58c372b938b0c 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<string mnemonic, list<OpTrait> 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<string mnemonic, list<OpTrait> 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 17a69b03671c4..a974a4fe92626 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


        


More information about the Mlir-commits mailing list