commit | a990f2cd5187d1d63585c7cda7793c0a3097d663 | [log] [tgz] |
---|---|---|
author | Tobias Gysi <gysit@google.com> | Thu Nov 25 10:23:28 2021 +0000 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Nov 25 02:36:22 2021 -0800 |
tree | e351dedb8121bf5baffe1a66015857c962ffd007 | |
parent | 50d22aff6707bd90040d64d0620baa19f2c09b2c [diff] |
[mlir][linalg] Add backward slice filtering in hoist padding. Adapt hoist padding to filter the backward slice before cloning the packing loop nest. The filtering removes all operations that are not used to index the hoisted pad tensor op and its extract slice op. The filtering is needed to support the more complex loop nests created after fusion. For example, fusing the producer of an output operand can added linalg ops and pad tensor ops to the backward slice. These operations have regions and currently prevent hoisting. The following example demonstrates the effect of the newly introduced `dropNonIndexDependencies` method that filters the backward slice: ``` %source = linalg.fill(%cst, %arg0) scf.for %i %unrelated = linalg.fill(%cst, %arg1) // not used to index %source! scf.for %j (%arg2 = %unrelated) scf.for %k // not used to index %source! %ubi = affine.min #map(%i) %ubj = affine.min #map(%j) %slice = tensor.extract_slice %source [%i, %j] [%ubi, %ubj] %padded_slice = linalg.pad_tensor %slice ``` dropNonIndexDependencies(%padded_slice, %slice) removes [scf.for %k, linalg.fill(%cst, %arg1)] from backwardSlice. Depends On D114175 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D114420 GitOrigin-RevId: ed7c1fb9b099193f0edafb58df2b2a91f561d6c2
See https://mlir.llvm.org/ for more information.