This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Linalg] Add more arith named ops to linalg
ClosedPublic

Authored by rengolin on Jul 5 2023, 9:32 AM.

Details

Summary

Following up the 'add' named op, here are the remaining basic arithmetic
and maths, including a 'div_unsigned' for integer unsigned values. In the
same pattern as 'matmul_unsigned', the simply named 'div' assumes signed
values and the '_unsigned' variation handles the unsigned values.

It's a bit odd, but there doesn't seem to be a easy way to restrict to
specific types to make 'div_unsigned' only work with integers in the
structured ops framework.

Same as 'add', these have strict semantics regarding casts.

Unary math ops will need some massaging, so I split these ones for now
as I continue working on them.

Diff Detail

Event Timeline

rengolin created this revision.Jul 5 2023, 9:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 9:32 AM
rengolin requested review of this revision.Jul 5 2023, 9:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 9:32 AM
nicolasvasilache accepted this revision.Jul 5 2023, 9:49 AM
This revision is now accepted and ready to land.Jul 5 2023, 9:49 AM
This revision was automatically updated to reflect the committed changes.

Yes, I already contacted the bot owner. Happy to do some investigation on my side, but I'm not sure how.

Oh well, that's a clear revert.

Ok, reverted. I'll try to reproduce the error and try again tomorrow.

Found it, I was missing the following arguments to my CMAKE:

-DMLIR_INCLUDE_INTEGRATION_TESTS=ON -DMLIR_ENABLE_BINDINGS_PYTHON=ON

Am looking at the errors and will try again once green.