This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Update affine.for unroll utility for iter_args support
ClosedPublic

Authored by bondhugula on Feb 9 2021, 4:31 PM.

Details

Summary

Update affine.for loop unroll utility for iteration arguments support.
Fix promoteIfSingleIteration as well.

Fixes https://bugs.llvm.org/show_bug.cgi?id=49084

Diff Detail

Event Timeline

bondhugula created this revision.Feb 9 2021, 4:31 PM
bondhugula requested review of this revision.Feb 9 2021, 4:31 PM
bondhugula updated this revision to Diff 322554.Feb 9 2021, 5:36 PM

Rebase on main tip. Minor doc comment and commit summary update.

dcaballe accepted this revision.Feb 9 2021, 8:16 PM

Thanks for the fix, Uday! LGTM. Just a couple of minor comments.

mlir/lib/Transforms/Utils/LoopUtils.cpp
153

Even if we limit the utility only to SCF and Affine for ops, would it be possible to use LoopLikeInterface here instead of the the template?

1169

nit: avoid auto here?

This revision is now accepted and ready to land.Feb 9 2021, 8:16 PM
bondhugula updated this revision to Diff 322583.Feb 9 2021, 9:08 PM
bondhugula marked an inline comment as done.

Address review comment on auto.

bondhugula marked an inline comment as done.Feb 9 2021, 9:08 PM
bondhugula added inline comments.
mlir/lib/Transforms/Utils/LoopUtils.cpp
153

I explored that but we unfortunately can't since not all ops that implement the LoopLikeOpInterface have a getIterOperands, getRegionIterArgs, or results.

This revision was landed with ongoing or failed builds.Feb 9 2021, 9:09 PM
This revision was automatically updated to reflect the committed changes.