@@ -37,7 +37,8 @@ class Builtin_Attr<string name, string attrMnemonic, list<Trait> traits = [],
3737//===----------------------------------------------------------------------===//
3838
3939def Builtin_AffineMapAttr : Builtin_Attr<"AffineMap", "affine_map", [
40- MemRefLayoutAttrInterface
40+ MemRefLayoutAttrInterface,
41+ OpAsmAttrInterface
4142 ]> {
4243 let summary = "An Attribute containing an AffineMap object";
4344 let description = [{
@@ -63,6 +64,16 @@ def Builtin_AffineMapAttr : Builtin_Attr<"AffineMap", "affine_map", [
6364 let extraClassDeclaration = [{
6465 using ValueType = AffineMap;
6566 AffineMap getAffineMap() const { return getValue(); }
67+
68+ //===------------------------------------------------------------------===//
69+ // OpAsmAttrInterface Methods
70+ //===------------------------------------------------------------------===//
71+
72+ /// Get a name to use when generating an alias for this attribute.
73+ ::mlir::OpAsmAliasResult getAlias(::llvm::raw_ostream &os) const {
74+ os << "map";
75+ return ::mlir::OpAsmAliasResult::OverridableAlias;
76+ }
6677 }];
6778 let skipDefaultBuilders = 1;
6879}
@@ -755,7 +766,7 @@ def Builtin_IntegerAttr : Builtin_Attr<"Integer", "integer",
755766// IntegerSetAttr
756767//===----------------------------------------------------------------------===//
757768
758- def Builtin_IntegerSetAttr : Builtin_Attr<"IntegerSet", "integer_set"> {
769+ def Builtin_IntegerSetAttr : Builtin_Attr<"IntegerSet", "integer_set", [OpAsmAttrInterface] > {
759770 let summary = "An Attribute containing an IntegerSet object";
760771 let description = [{
761772 Syntax:
@@ -776,7 +787,19 @@ def Builtin_IntegerSetAttr : Builtin_Attr<"IntegerSet", "integer_set"> {
776787 return $_get(value.getContext(), value);
777788 }]>
778789 ];
779- let extraClassDeclaration = "using ValueType = IntegerSet;";
790+ let extraClassDeclaration = [{
791+ using ValueType = IntegerSet;
792+
793+ //===------------------------------------------------------------------===//
794+ // OpAsmAttrInterface Methods
795+ //===------------------------------------------------------------------===//
796+
797+ /// Get a name to use when generating an alias for this attribute.
798+ ::mlir::OpAsmAliasResult getAlias(::llvm::raw_ostream &os) const {
799+ os << "set";
800+ return ::mlir::OpAsmAliasResult::OverridableAlias;
801+ }
802+ }];
780803 let skipDefaultBuilders = 1;
781804}
782805
0 commit comments