Hi!
I have a constant operation in my dialect that contains an ElementsAttr
that stores the value. It looks something like this:
def Constant : My_Op<"Constant", [NoMemoryEffect]> {
let arguments = (ins ElementsAttr : $value);
...
}
This ElementsAttr
is often used to store large and unique constants. Since attributes in MLIR will live for the entirety of the process, these large weights increase the memory usage of the compiler, even long after they are not needed. With the new addition of Properties in MLIR, if these ElementsAttr
s become Properties, they should be de-allocated after the operation has been destroyed. This should lead to an overall decrease in memory usage.
My question is, how do we go about defining an ElementsAttr
(or something equivalent) as a property in MLIR? I’ve looking through the documentation, past presentation and looking at the test dialect but couldn’t figure it out. I would like to keep using the ElementsAttr
interface but just have it not be stored in the context.
Thanks in advance for the help!