This is an archive of the discontinued LLVM Phabricator instance.

[mlir][python] Add python bindings for DenseArrayAttr
ClosedPublic

Authored by Mogball on Aug 12 2022, 12:52 PM.

Details

Summary

This patch adds python bindings for the dense array variants.

Fixes #56975

Diff Detail

Event Timeline

Mogball created this revision.Aug 12 2022, 12:52 PM
Mogball requested review of this revision.Aug 12 2022, 12:52 PM
Mogball edited the summary of this revision. (Show Details)Aug 12 2022, 1:05 PM
ftynse accepted this revision.Aug 12 2022, 2:35 PM
ftynse added inline comments.
mlir/lib/Bindings/Python/IRAttributes.cpp
138

Nit: I remember throw-based approach being inefficient so we opted for a direct implementation of the iterator protocol elsewhere. No need to change here, but please add a TODO/bug.

187–188

This wouldn't concat two attributes though, would it?

This revision is now accepted and ready to land.Aug 12 2022, 2:35 PM
This revision was automatically updated to reflect the committed changes.

I set up my windows build but didn't get the same build error. Are you able to reproduce it?

I set up my windows build but didn't get the same build error. Are you able to reproduce it?

Yes, I can reproduce it on one of my machines, but not the other and our internal buildbots can also (in addition to the public bot). I suspect it's an issue with the Visual Studio version (the passing one is the newest version of the set). What version are you using?

I would suggest reverting this change until we can figure out what the issue is since the buildbot has been broken all weekend.

I believe this snippet (compiled with MSVC) reproduces the error. Interestingly, clang fails to compile that same snippet, which makes me wonder if that code or file is #ifdef-ed somewhere.