This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ODS] Add support for specifying the successors of an operation.
ClosedPublic

Authored by rriddle on Feb 18 2020, 11:33 AM.

Details

Summary

This revision add support in ODS for specifying the successors of an operation. Successors are specified via the successors list:

let successors = (successor AnySuccessor:$target, AnySuccessor:$otherTarget);

Depends On D74683

Diff Detail

Event Timeline

rriddle created this revision.Feb 18 2020, 11:33 AM
jpienaar accepted this revision.Feb 18 2020, 2:37 PM

NIce

mlir/lib/TableGen/Operator.cpp
316

Where does/could 'successorsOp->getDef()->getName() != "successor"' happen?

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
1393

Wouldn't formatv(...).str() also give this?

Feels a little weird to have a variable called name with spaces ...

1401

Why not move this up and then you can emit the name directly in the body rather than concatting string above?

1470

It is a little bit difficult to correlate variadic operands with successors, could you explain that here?

This revision is now accepted and ready to land.Feb 18 2020, 2:37 PM
rriddle updated this revision to Diff 245314.Feb 18 2020, 6:59 PM
rriddle marked 5 inline comments as done.

Resolve comments

rriddle added inline comments.Feb 20 2020, 9:13 PM
mlir/lib/TableGen/Operator.cpp
316

I'm assuming this is intended to capture cases like : let successors = (outs ...); or let successors = (regions ...);. I followed suit with what the regions/results/etc. lists were verifying.

antiagainst accepted this revision.Feb 21 2020, 12:30 PM

Cool! Thanks River for adding this! Can we also update the doc ?

mlir/include/mlir/TableGen/Operator.h
212

I've default to 0. I think typically ops don't have successors anyway.

rriddle updated this revision to Diff 245974.Feb 21 2020, 1:11 PM
rriddle marked an inline comment as done.

Resolve comments.

This revision was automatically updated to reflect the committed changes.
bondhugula added inline comments.
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
235

Where did 'arguments' disappear here? (i.e., where are the operands associated with successors?) I don't see the documentation being updated on this.