Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
80 ms | x64 windows > LLVM.CodeGen/XCore::threads.ll |
Event Timeline
Thanks!
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1904 | 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. | |
1910–1935 | Can this be defined as a member function rather than a long lambda? | |
1911 | Do we really need to make this optional? Creating an empty dictionary attribute from an empty dictionary makes more sense to me. | |
1938–1939 | 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 | ||
---|---|---|
1913 | 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? | |
1920 | Nit: remove the c_str(), it is only pessimizing here. |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1913 | In mlirNamedAttributeGet, it use MlirStringRef. Are there other ways better? |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1913 | 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 | ||
---|---|---|
1913 | Yes, we must have a todo somewhere to fix that, legacy from early iterations of C API. |
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
1913 | 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 | ||
---|---|---|
1933 | 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!
clang-format not found in user's PATH; not linting file.