diff --git a/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td b/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td index eb6e293bbf4f6..9b0020e985cd2 100644 --- a/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td +++ b/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td @@ -40,6 +40,9 @@ def MLProgram_ExternAttr : MLProgram_Attr<"Extern", [TypedAttrInterface]> { let parameters = (ins AttributeSelfTypeParameter<"">:$type); let mnemonic = "extern"; let assemblyFormat = ""; + + // Generate mnemonic alias for the attribute. + let genMnemonicAlias = 1; } #endif // MLPROGRAM_ATTRIBUTES diff --git a/mlir/lib/Dialect/MLProgram/IR/MLProgramDialect.cpp b/mlir/lib/Dialect/MLProgram/IR/MLProgramDialect.cpp index bda1032ed9884..0b1561213165b 100644 --- a/mlir/lib/Dialect/MLProgram/IR/MLProgramDialect.cpp +++ b/mlir/lib/Dialect/MLProgram/IR/MLProgramDialect.cpp @@ -39,14 +39,6 @@ struct MLProgramInlinerInterface : public DialectInlinerInterface { struct MLProgramOpAsmDialectInterface : public OpAsmDialectInterface { using OpAsmDialectInterface::OpAsmDialectInterface; - - AliasResult getAlias(Attribute attr, raw_ostream &os) const override { - if (llvm::isa(attr)) { - os << "extern"; - return AliasResult::OverridableAlias; - } - return AliasResult::NoAlias; - } }; } // namespace