This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][bufferize] Handle scf::ForOp correctly in bufferizesToMemoryRead
ClosedPublic

Authored by springerm on Oct 13 2021, 10:09 PM.

Details

Summary

From the perspective of analysis, scf::ForOp is treated as a black box. Basic block arguments do not alias with their respective OpOperands on the ForOp, so they do not participate in conflict analysis with ops defined outside of the loop.

However, bufferizesToMemoryRead and bufferizesToMemoryWrite on the scf::ForOp itself are used to determine how the scf::ForOp interacts with its surrounding ops.

Depends On D111287

Diff Detail

Event Timeline

springerm created this revision.Oct 13 2021, 10:09 PM
springerm requested review of this revision.Oct 13 2021, 10:09 PM
springerm added a comment.EditedOct 13 2021, 10:12 PM

Lesson learned today: Our current analysis is "block scoped". We never analyze conflicts between an op and another op in the parent block. This is an important design decision that should be mentioned in the design doc. It simplifies the analysis significantly.

Depending on what kind of scf.if cases we want to handle in the future, this design decision may change.

nicolasvasilache accepted this revision.Oct 14 2021, 7:18 AM

Great, thanks !

This revision is now accepted and ready to land.Oct 14 2021, 7:18 AM
This revision was landed with ongoing or failed builds.Oct 14 2021, 7:24 PM
This revision was automatically updated to reflect the committed changes.