Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks!
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1987 | This should be getting a context of _this_ attribute instead of accepting any context as argument. PyConcreteAttribute has a field containing the current attribute IIRC. | |
1993–2018 | Can this be defined as a member function rather than a long lambda? | |
1994 | Do we really need to make this optional? Creating an empty dictionary attribute from an empty dictionary makes more sense to me. | |
2021–2022 | Ideally, we would have the same interface querying for DictAttr as we do for the attrs field on ops, i.e. also have an indexed getitem. | |
mlir/test/Bindings/Python/ir_attributes.py | ||
281 | Please also add a check that the exception is thrown for non-existent attribute. |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1996 | Instead of creating a vector of pair<string,MlirAttribute> and then use it to build a vector of MlirNamedAttribute, can you just build a vector of MlirNamedAttribute in the first place? | |
2003 | Nit: remove the c_str(), it is only pessimizing here. |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1996 | In mlirNamedAttributeGet, it use MlirStringRef. Are there other ways better? |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1996 | Oh, it seems that MlirNamedAttribute are non-owning for the key... This is specific to the C API, the C++ API creates a context-owned string instead. I think we should change the C API. I'm doing it here: https://reviews.llvm.org/D93133 |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1996 | Yes, we must have a todo somewhere to fix that, legacy from early iterations of C API. |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1996 | Alright this is landed, if you rebase you can eliminate this extra vector now :) |
Great!
I fixed it with eliminating extra vector .
Please help me review this commit.
Thanks.
LGTM!
Do you need me to land this for you? (if so please let me know the authorship information: name/email).
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
2016 | Please run git clang-format (arc does it for you I believe) |
Yes, i would contribute more for this project :)
name: kweisamx
email: kweisamx0322@gmail.com
Thank!
This should be getting a context of _this_ attribute instead of accepting any context as argument. PyConcreteAttribute has a field containing the current attribute IIRC.