This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add a simpler lowering pattern for WhileOp representing a do-while loop
ClosedPublic

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

Details

Summary

When the "after" region of a WhileOp is merely forwarding its arguments back to
the "before" region, i.e. WhileOp is a canonical do-while loop, a simpler CFG
subgraph that omits the "after" region with its extra branch operation can be
produced. Loop rotation from general "while" to "if { do-while }" is left for a
future canonicalization pattern when it becomes necessary.

Depends On D90603

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 accepted this revision.Nov 2 2020, 5:44 PM

LGTM once the others are approved

This revision is now accepted and ready to land.Nov 2 2020, 5:44 PM