This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Affine] Privatize certain escaping memrefs
ClosedPublic

Authored by vinayaka-polymage on May 17 2021, 3:16 AM.

Details

Summary

During affine loop fusion, create private memrefs for escaping memrefs
too under the conditions that:

  • the source is not removed after fusion, and
  • the destination does not write to the memref.

This creates more fusion opportunities as illustrated in the test case.

Diff Detail

Event Timeline

vinayaka-polymage requested review of this revision.May 17 2021, 3:16 AM

Nice improvement. A couple of comments.

mlir/lib/Transforms/LoopFusion.cpp
1582

The "source is not removed after fusion" part of the condition needs an additional line of explanation I think.

mlir/test/Transforms/loop-fusion.mlir
1209

Nice!

3075

Typo: should be ... and has two consumers?

Thanks for the quick review, corrected the typos, and added additional
comments for clarification.

vinayaka-polymage marked 3 inline comments as done.May 17 2021, 4:49 AM

Addressed typos.

ayzhuang accepted this revision.May 17 2021, 9:40 AM

Looks great!

This revision is now accepted and ready to land.May 17 2021, 9:40 AM
bondhugula accepted this revision.May 18 2021, 5:26 AM

Looks great - thanks!

This revision was landed with ongoing or failed builds.May 18 2021, 9:56 AM
This revision was automatically updated to reflect the committed changes.