This is an archive of the discontinued LLVM Phabricator instance.

[mlir][python] improve usability of Python affine construct bindings
ClosedPublic

Authored by ftynse on Nov 2 2021, 6:15 AM.

Details

Summary
  • Provide the operator overloads for constructing (semi-)affine expressions in Python by combining existing expressions with constants.
  • Make AffineExpr, AffineMap and IntegerSet hashable in Python.
  • Expose the AffineExpr composition functionality.

Diff Detail

Event Timeline

ftynse created this revision.Nov 2 2021, 6:15 AM
ftynse requested review of this revision.Nov 2 2021, 6:15 AM
aoyal added a subscriber: aoyal.Nov 2 2021, 6:46 AM
ftynse added a reviewer: aoyal.Nov 3 2021, 1:32 AM
aoyal accepted this revision.Nov 3 2021, 1:55 AM
This revision is now accepted and ready to land.Nov 3 2021, 1:55 AM
gysit accepted this revision.Nov 3 2021, 2:17 AM

LGTM!

mlir/lib/Bindings/Python/IRAffine.cpp
237

Shouldn't this be an PyAffineMulExpr? It probably doe not matter since both are affine expressions internally? The same would apply below to the modulo / div operators.

587

nit: modulo

ftynse updated this revision to Diff 384372.Nov 3 2021, 2:47 AM
ftynse marked an inline comment as done.

Address review.

This revision was landed with ongoing or failed builds.Nov 3 2021, 2:48 AM
This revision was automatically updated to reflect the committed changes.