This is an archive of the discontinued LLVM Phabricator instance.

[mlir] LoopToStandard conversion: support "if/else" with results
ClosedPublic

Authored by ftynse on Apr 3 2020, 10:57 AM.

Details

Summary

A recent extension allowed the loop.if operation to return results yielded by
its regions. However, such operations could not be lowered to a CFG of standard
operations because it would have required to modify the argument list of a
block, which is not allowed in a conversion pattern. Now that the conversion
infrastructure supports block creation, use it to create a block with an
argument list that dominates the operations following the loop.if and forward
the results as arguments of this block.

Depends On D77416

Diff Detail

Event Timeline

ftynse created this revision.Apr 3 2020, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2020, 10:57 AM
gysit accepted this revision.Apr 3 2020, 12:45 PM

Thanks for fixing this. Should have had that idea myself!

This revision is now accepted and ready to land.Apr 3 2020, 12:45 PM
ftynse added a comment.Apr 3 2020, 2:48 PM

Thanks for fixing this. Should have had that idea myself!

It needed changes to the rewriting infrastructure from D77416, took me some time to figure those out :)

This revision was automatically updated to reflect the committed changes.