I’d like to change the underlying type for StrEnumAttr and BitEnumAttr from 32-bit integer to 64-bit int.
For this I see that the mlir/include/mlir/IR/OpBase.td file contains this definition:
// An enum attribute case stored with StringAttr.
class StrEnumAttrCase<string sym, int val = -1, string str = sym> :
EnumAttrCaseInfo<sym, val, str>,
CPred<"$_self.cast<::mlir::StringAttr>().getValue() == “” # str # “”">,
"case " # str>;
More exactly, this definition specifies that the underlying type for StrEnumAttr is int, the 32-bit integer type.
Could you please tell me how can I change this underlying type for StrEnumAttr to 64-bit integer type? I ask because I tried without success various types instead of int, like long, int64_t, i64, I64.
Can you use EnumAttr instead of StringAttr? See [PSA] Stop using StrEnumAttr (Do use EnumAttr) which intends to deprecate StringAttr.
Thank you very much for your suggestions. I have used with success the EnumAttr, more exactly I64EnumAttr (I followed the suggestions from [PSA] Stop using StrEnumAttr (Do use EnumAttr) ).
Can you help me also with making BitEnumAttr have a 64-bits underlying type?
(Out of curiosity, although it’s not really important, isn’t it possible to use 32-bit unsigned int instead of 32-bit int for the underlying type of StrEnumAttr? Is it possible to specify in TableGen that I want to use the primitive type “unsigned int” instead of int for this definition of list element for StrEnumAttr: class StrEnumAttrCase<string sym, int val = -1, string str = sym> : …)