Custom attributes can be set on the operation. It prevents them to be
removed when doing named ops conversion.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Linalg/Transforms/NamedOpConversions.cpp | ||
---|---|---|
94–96 | Might be a better way of doing this. All ops have an attrName list. These are names of attributes that are defined in the tablegen op definition. Copy over everything that is not that. |
mlir/lib/Dialect/Linalg/Transforms/NamedOpConversions.cpp | ||
---|---|---|
94–96 | I finally figure out how to use the method. getAttributeNames only works at op level. It does not work at Operation* level. I think it does look better because we do declare elidedAttrs variable, which has better readability. |
mlir/lib/Dialect/Linalg/Transforms/NamedOpConversions.cpp | ||
---|---|---|
94–96 | Thanks!. The kMemoizedIndexingMapAttrName is tricky.... thanks for catching that.... Ill stamp this, but probably something similar is needed in other places. Maybe moving it to a Linalg/Utils/Utils.h is worth it. |
Address comments.
- Add the method to Utils.h
- Use TypeSwitch
mlir/lib/Dialect/Linalg/Transforms/NamedOpConversions.cpp | ||
---|---|---|
94–96 | Moved! Yes, I like TypeSwitch better. I followed the logic so I did not change it. let's switch to use TypeSwitch. |
Might be a better way of doing this. All ops have an attrName list. These are names of attributes that are defined in the tablegen op definition. Copy over everything that is not that.