This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Drop reliance of SliceAnalysis on specific ops.
ClosedPublic

Authored by nicolasvasilache on Feb 15 2021, 4:17 AM.

Details

Summary

SliceAnalysis originally was developed in the context of affine.for within mlfunc.
It predates the notion of region.
This revision updates it to not hardcode specific ops like scf::ForOp.
When rooted at an op, the behavior of the slice computation changes as it recurses into the regions of the op. This does not support gathering all values transitively depending on a loop induction variable anymore.
Additional variants rooted at a Value are added to also support the existing behavior.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Feb 15 2021, 4:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2021, 4:17 AM
ftynse accepted this revision.Feb 15 2021, 5:17 AM

Please look at the compilation failure on Windows before submitting.

mlir/include/mlir/Analysis/SliceAnalysis.h
80–81

This may break gcc-5, similarly to the other patch with lambdas as default arguments that we debugged on Friday...

mlir/lib/Analysis/SliceAnalysis.cpp
85

FuncOp is still a specific op :) Should we stop at anything IsolatedFromAbove instead?

This revision is now accepted and ready to land.Feb 15 2021, 5:17 AM
nicolasvasilache marked 2 inline comments as done.Feb 15 2021, 1:41 PM
nicolasvasilache added inline comments.
mlir/include/mlir/Analysis/SliceAnalysis.h
80–81

Moved to llvm::funtion_ref + nullptr default, thanks!

nicolasvasilache marked an inline comment as done.

Addres comments + rebase.