This pattern is useful when we have extract->compute->insert op
patterns inside loops and the extract/insert offsets/sizes/strides
are all loop invariant. Such op patterns can be generated via,
for example, unrolling tiled loops.
Details
- Reviewers
ThomasRaoux nicolasvasilache mravishankar
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It would be good to unify the impl. and helper functions with lib/Dialect/Linalg/Transforms/Hoisting.cpp and/or bufferization and explicitly disallow having multiple different implementations (e.g. findMatchingExtractSlice or something very close must already exist somewhere, please refactor as you need to have 1 version that we can later evolve into an analysis or interface).
Adding @ThomasRaoux to weigh in since he wrote the hoisting.cpp part.
mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt | ||
---|---|---|
4 | Please suffix this file name with Patterns -> HoistExtractInsertSlicePatterns.cpp |
@nicolasvasilache: sure thing. I'll chat with Thomas to see how we can clean up these. I suspect we can disentangle the logic in Hoisting.cpp, which right now does both tensor and vector hoisting. We should be able to rely on this new pattern for tensor specifically and make vector side simpler. (Both side needs similar analysis, which we can also try to see how to unify.)
@nicolasvasilache: I've uploaded D135546 to refactor the vector transfer hoisting logic to not doing tensor slice op hoisting; instead to use this as a prelimiary step as said in the above. I'll try to extract more common utilities to share next.
Please suffix this file name with Patterns -> HoistExtractInsertSlicePatterns.cpp