This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add lowering to CFG for WhileOp
ClosedPublic

Authored by ftynse on Nov 2 2020, 6:00 AM.

Details

Summary

The lowering is a straightforward inlining of the "before" and "after" regions
connected by (conditional) branches. This plugs the WhileOp into the
progressive lowering scheme. Future commits may choose to target WhileOp
instead of CFG when lowering ForOp.

Depends On D90255

Diff Detail

Event Timeline

ftynse created this revision.Nov 2 2020, 6:00 AM
ftynse requested review of this revision.Nov 2 2020, 6:00 AM
aartbik added inline comments.Nov 2 2020, 5:43 PM
mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp
257

what do you mean by "ex-regions" here?

mlir/test/Conversion/SCFToStandard/convert-to-cfg.mlir
449

can you break this in two lines?

474

same, and below, reads a bit easier

ftynse updated this revision to Diff 302508.Nov 3 2020, 1:34 AM
ftynse marked 2 inline comments as done.

Address review

mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp
257

The groups of blocks that used to form a region before inlining.

aartbik accepted this revision.Nov 3 2020, 10:25 AM
aartbik added inline comments.
mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp
257

I actually also meant to spell that out a bit more clearly in the actual comments :-)

This revision is now accepted and ready to land.Nov 3 2020, 10:25 AM
mehdi_amini accepted this revision.Nov 3 2020, 12:10 PM
mehdi_amini added inline comments.
mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp
508

That's amazingly simple :)

ftynse updated this revision to Diff 302763.Nov 4 2020, 12:42 AM
ftynse marked an inline comment as done.

Address review

mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp
508

The rewriter infrastructure investment starts to pay off :)

This revision was landed with ongoing or failed builds.Nov 4 2020, 12:44 AM
This revision was automatically updated to reflect the committed changes.