For ODS generated operations, enable querying whether there is a derived
attribute with a given name.
Details
- Reviewers
mehdi_amini rriddle
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Derived attributes are attributes that are not stored in the Op but instead computed from properties of the op (https://mlir.llvm.org/docs/OpDefinitions/#operation-arguments). E.g., a derived attribute T corresponding to the result type results in a convenience accessor T() that returns the result type but is not additionally stored. This allows for convenience functions that query the op (and return the result in convenient user usable format) without needing to store redundant information.
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | ||
---|---|---|
401 | nit: Can we just use llvm::is_contained instead? That would avoid bringing in StringSwitch to OperationSupport, which is included in a lot of places. |
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | ||
---|---|---|
401 | It is probably less efficient compared to the StringSwitch. But I do agree it is a smaller dependency though, and we could optimize this if it is problematic. |
nit: Can we just use llvm::is_contained instead? That would avoid bringing in StringSwitch to OperationSupport, which is included in a lot of places.