diff --git a/mlir/include/mlir/IR/OpImplementation.h b/mlir/include/mlir/IR/OpImplementation.h --- a/mlir/include/mlir/IR/OpImplementation.h +++ b/mlir/include/mlir/IR/OpImplementation.h @@ -1350,10 +1350,6 @@ return AliasResult::NoAlias; } - /// Get a special name to use when printing the given operation. See - /// OpAsmInterface.td#getAsmResultNames for usage details and documentation. - virtual void getAsmResultNames(Operation *op, - OpAsmSetValueNameFn setNameFn) const {} }; } // namespace mlir diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -797,8 +797,7 @@ /// A sentinel value used for values with names set. enum : unsigned { NameSentinel = ~0U }; - SSANameState(Operation *op, const OpPrintingFlags &printerFlags, - DialectInterfaceCollection &interfaces); + SSANameState(Operation *op, const OpPrintingFlags &printerFlags); /// Print the SSA identifier for the given value to 'stream'. If /// 'printResultNo' is true, it also presents the result number ('#' number) @@ -866,15 +865,12 @@ /// These are the printing flags. They control, eg., whether to print in /// generic form. OpPrintingFlags printerFlags; - - DialectInterfaceCollection &interfaces; }; } // namespace SSANameState::SSANameState( - Operation *op, const OpPrintingFlags &printerFlags, - DialectInterfaceCollection &interfaces) - : printerFlags(printerFlags), interfaces(interfaces) { + Operation *op, const OpPrintingFlags &printerFlags) + : printerFlags(printerFlags) { llvm::SaveAndRestore valueIDSaver(nextValueID); llvm::SaveAndRestore argumentIDSaver(nextArgumentID); llvm::SaveAndRestore conflictIDSaver(nextConflictID); @@ -1071,8 +1067,6 @@ if (!printerFlags.shouldPrintGenericOpForm()) { if (OpAsmOpInterface asmInterface = dyn_cast(&op)) asmInterface.getAsmResultNames(setResultNameFn); - else if (auto *asmInterface = interfaces.getInterfaceFor(op.getDialect())) - asmInterface->getAsmResultNames(&op, setResultNameFn); } // If the first result wasn't numbered, give it a default number. @@ -1172,7 +1166,7 @@ public: explicit AsmStateImpl(Operation *op, const OpPrintingFlags &printerFlags, AsmState::LocationMap *locationMap) - : interfaces(op->getContext()), nameState(op, printerFlags, interfaces), + : interfaces(op->getContext()), nameState(op, printerFlags), printerFlags(printerFlags), locationMap(locationMap) {} /// Initialize the alias state to enable the printing of aliases. diff --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir --- a/mlir/test/IR/parser.mlir +++ b/mlir/test/IR/parser.mlir @@ -1209,18 +1209,15 @@ func private @nested_reference() attributes {test.ref = @some_symbol::@some_nested_symbol } // CHECK-LABEL: func @custom_asm_names -func @custom_asm_names() -> (i32, i32, i32, i32, i32, i32, i32) { +func @custom_asm_names() -> (i32, i32, i32, i32, i32, i32) { // CHECK: %[[FIRST:first.*]], %[[MIDDLE:middle_results.*]]:2, %[[LAST:[0-9]+]] %0, %1:2, %2 = "test.asm_interface_op"() : () -> (i32, i32, i32, i32) // CHECK: %[[FIRST_2:first.*]], %[[LAST_2:[0-9]+]] %3, %4 = "test.asm_interface_op"() : () -> (i32, i32) - // CHECK: %[[RESULT:result.*]] - %5 = "test.asm_dialect_interface_op"() : () -> (i32) - // CHECK: return %[[FIRST]], %[[MIDDLE]]#0, %[[MIDDLE]]#1, %[[LAST]], %[[FIRST_2]], %[[LAST_2]] - return %0, %1#0, %1#1, %2, %3, %4, %5 : i32, i32, i32, i32, i32, i32, i32 + return %0, %1#0, %1#1, %2, %3, %4 : i32, i32, i32, i32, i32, i32 } diff --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp --- a/mlir/test/lib/Dialect/Test/TestDialect.cpp +++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp @@ -99,12 +99,6 @@ } return AliasResult::NoAlias; } - - void getAsmResultNames(Operation *op, - OpAsmSetValueNameFn setNameFn) const final { - if (auto asmOp = dyn_cast(op)) - setNameFn(asmOp, "result"); - } }; struct TestDialectFoldInterface : public DialectFoldInterface {