- Added more default values for attributes parameter for 2 more build methods
- Extend the op-decls.td unit test to test these build methods.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | ||
---|---|---|
1056 | Note, eliminating use of formatv() as it does not correctly handle escaped closing braces. I have put up a fix for that (https://reviews.llvm.org/D83837) but here we don't need to use formatv. |
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | ||
---|---|---|
1025 | Part of me wonders if we should where ops has required attributes. E.g., if we know op X requires an attribute (not default and not optional), then any invocation of build that doesn't pass an attribute will fail verification. Unless added later which we would have no knowledge of here, but this would force them to think about it. I'm not sure the value of complicating this for that use though, so good as is. | |
1056 | Interesting, I thought there was some trick wrt escaping that we had used elsewhere. |
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | ||
---|---|---|
1025 | FYI, I have seen cases of this where we call build() with empty attributes and then tack on a bunch of attributes on the generated operation. |
Part of me wonders if we should where ops has required attributes. E.g., if we know op X requires an attribute (not default and not optional), then any invocation of build that doesn't pass an attribute will fail verification. Unless added later which we would have no knowledge of here, but this would force them to think about it.
I'm not sure the value of complicating this for that use though, so good as is.