Page MenuHomePhabricator

[mlir][scf] Fix a bug in scf::ForOp loop unroll with an epilogue
Needs RevisionPublic

Authored by tatianashp on Sat, Sep 12, 7:22 PM.

Details

Summary

Fixes a bug in formation and simplification of an epilogue loop generated
during loop unroll of scf::ForOp (https://bugs.llvm.org/show_bug.cgi?id=46689)

Diff Detail

Event Timeline

tatianashp created this revision.Sat, Sep 12, 7:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptSat, Sep 12, 7:22 PM
tatianashp requested review of this revision.Sat, Sep 12, 7:22 PM
mehdi_amini accepted this revision.Sat, Sep 12, 9:30 PM
mehdi_amini added inline comments.
mlir/test/Transforms/scf-loop-unroll.mlir
1

Can you remove the -allow-unregistered-dialect here and use std.add (or another test operation), and same for types?

This revision is now accepted and ready to land.Sat, Sep 12, 9:30 PM
tatianashp edited the summary of this revision. (Show Details)Sun, Sep 13, 12:57 PM
bondhugula requested changes to this revision.Sun, Sep 13, 11:09 PM
bondhugula added a subscriber: bondhugula.
bondhugula added inline comments.
mlir/lib/Transforms/Utils/LoopUtils.cpp
217

Nit: consider using getTerminator() instead of back() for better readability.

mlir/test/Transforms/scf-loop-unroll.mlir
8

Could you make it 11 iterations to make the test stronger (or an additional one if you prefer)? Is coverage missing for a symbolic upper bound in the presence of return values?

This revision now requires changes to proceed.Sun, Sep 13, 11:09 PM
mehdi_amini added inline comments.Sun, Sep 13, 11:13 PM
mlir/test/Transforms/scf-loop-unroll.mlir
8

I believe the crash from PR46689 only exists when the epilogue has a single iteration