I need a U164ArrayAttr for my code but I see it is not defined MLIR: mlir::Builder Class Reference
Is there a particular reason ? If not, if I were to define it for my own code, would it be possible (e.g. I am not sure if "$_builder.getUI64ArrayAttr($0)"; would work as is.
Where all would I need to add support code.
For my purpose I feel indexType would be right, but every time I try to use it I get stuck as it keeps erorring on ‘not an index type’. Also not sure if index type is uint64_t.
Those methods are creating signless ints, not signed ones, so a UI64 method wouldn’t really make sense without also having a signed version.
These tablegen shorthands are generally added as necessary. Personally, I think having these shorthands in a generic place is frequently not great. They’re not exhaustive so you spend forever trying to figure out whether there’s already a shorthand for it.
It depends on what you are trying to do. Did you read the rationale section I linked? An I32 attr is just an integer with 32 bits. It does not carry information on whether the first bit should be interpreted as a sign bit. Whether you want to encode how to interpret the sign bit in your attribute is up to you. Having an attribute constrained to be non-negative is not the same as it being unsigned (in fact it implies that it is signed but always has a 0 as the first bit).
fooOp.val() will be an IntegerAttr, not unsigned. It contains an APInt
If I have something like std::vector<... e.g. int ... > values then what would be the right way to define an attribute in the ops.td for it? Should I use ArrayAttr ? Any help on similar codes that store and retrieve similar structures from ops and build ops with it will be useful. I have used DenseElementsAttr before but that seems more suited for multi-dim shapes.
Thanks a lot