This is an archive of the discontinued LLVM Phabricator instance.

[mlir][PDL] Add support for variadic operands and results in the PDL Interpreter
ClosedPublic

Authored by rriddle on Jan 29 2021, 7:56 PM.

Details

Summary

This revision extends the PDL Interpreter dialect to add support for variadic operands and results, with ranges of these values represented via the recently added !pdl.range type. To support this extension, three new operations have been added that closely match the single variant:

  • pdl_interp.check_types : Compare a range of types with a known range.
  • pdl_interp.create_types : Create a constant range of types.
  • pdl_interp.get_operands : Get a range of operands from an operation.
  • pdl_interp.get_results : Get a range of results from an operation.
  • pdl_interp.switch_types : Switch on a range of types.

This revision handles adding support in the interpreter dialect and the conversion from PDL to PDLInterp. Support for variadic operands and results in the bytecode will be added in a followup revision.

Depends On D95721

Diff Detail

Event Timeline

rriddle created this revision.Jan 29 2021, 7:56 PM
rriddle requested review of this revision.Jan 29 2021, 7:56 PM
jpienaar accepted this revision.Mar 10 2021, 10:06 AM
jpienaar added inline comments.
mlir/lib/Conversion/PDLToPDLInterp/Predicate.cpp
22

Clang-tidy suggestion

mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
132

Could we use the positive form instead?

This revision is now accepted and ready to land.Mar 10 2021, 10:06 AM
rriddle updated this revision to Diff 330790.Mar 15 2021, 1:25 PM
rriddle marked 2 inline comments as done.

rebase

This revision was landed with ongoing or failed builds.Mar 16 2021, 1:20 PM
This revision was automatically updated to reflect the committed changes.

It looks like this is failing on Windows MLIR bot:

https://lab.llvm.org/buildbot/#/builders/13/builds/5779

Yep, looking into it right now. Thanks.

It looks like this is failing on Windows MLIR bot:

https://lab.llvm.org/buildbot/#/builders/13/builds/5779

Yep, looking into it right now. Thanks.

Apologies for the delay, I think it should be fixed by 1f13963ec14a5c664633f78856e70de1d40258cd (it worked on my windows machine at least). I have no idea why MSVC is doing that, but I don't really think it should.