This is an archive of the discontinued LLVM Phabricator instance.

Add DivOp to the Shape dialect
ClosedPublic

Authored by Jing on Feb 17 2021, 3:00 PM.

Diff Detail

Event Timeline

Jing created this revision.Feb 17 2021, 3:00 PM
Jing requested review of this revision.Feb 17 2021, 3:00 PM
jpienaar accepted this revision.Feb 18 2021, 11:38 AM
jpienaar added inline comments.
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
144

Divides

149–152

I think lets turn these around and say it follows floor(x / y) [I mean the equation of interest to me is mod(a, n) = a - n * floor(a / n) and yes it corresponds to python operator but the motivation is inverted for me :) ]

mlir/lib/Dialect/Shape/IR/Shape.cpp
615

Same here

mlir/test/Dialect/Shape/canonicalize.mlir
986

Could you add div(10, -4) too? (wouldn't matter for div but could for mod, and then I'd want to just extend these tests in that case)

This revision is now accepted and ready to land.Feb 18 2021, 11:38 AM
Jing updated this revision to Diff 324765.Feb 18 2021, 2:01 PM

Resolved review comments.

Jing marked 4 inline comments as done.Feb 18 2021, 2:01 PM

Could you help me land the path?

This revision was automatically updated to reflect the committed changes.