Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

[mlir][linalg][transform][python] Extend mix-in for Vectorize

Authored by martin-luecke on Aug 24 2023, 4:54 AM.



Extends the existing mix-in for VectorizeOp with support for the missing unit attributes.

Also fixes the unintuitive implementation where
structured.VectorizeOp(target=target, vectorize_padding=False) still resulted in the creation of the UnitAttr vectorize_padding.

Diff Detail

Event Timeline

martin-luecke created this revision.Aug 24 2023, 4:54 AM
Herald added a project: Restricted Project. · View Herald Transcript
martin-luecke requested review of this revision.Aug 24 2023, 4:54 AM
martin-luecke edited the summary of this revision. (Show Details)Aug 24 2023, 4:54 AM
ingomueller-net accepted this revision.Aug 24 2023, 9:17 AM
ingomueller-net added inline comments.

That cast should not be necessary; you just tested if it's an instance of bool, no?


Is all of this really necessary? Doesn't the generated code handle Booleans? I one case, I see this:

if bool(bufferize_destination_only): attributes["bufferize_destination_only"] = _ods_ir.UnitAttr.get(

Doesn't this handle all cases as desired if you remove the whole 12 lines?

This revision is now accepted and ready to land.Aug 24 2023, 9:17 AM

Address review comments:

  • simplify mix-in to rely more on the generated constructor
martin-luecke marked 2 inline comments as done.Aug 25 2023, 12:41 AM

Thank you for your comments @ingomueller-net.

I do not yet have commit privileges so if you are happy with the state I would appreciate it if you could commit this on my behalf.

OK, done! Unfortunately, I show up as an author now on git. I spend a bit of time trying to find out who was going to be the author and how to make sure it remains you but I didn't find anything. Turns out that the one who lands becomes the author...