99#ifndef MLIR_DIALECT_LINALG_UTILS_UTILS_H
1010#define MLIR_DIALECT_LINALG_UTILS_UTILS_H
1111
12- #include " mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h"
1312#include " mlir/Dialect/Linalg/IR/Linalg.h"
1413#include " mlir/Dialect/SCF/IR/SCF.h"
15- #include " llvm/ADT/MapVector.h"
1614#include " llvm/ADT/StringSet.h"
1715#include < optional>
1816
@@ -27,7 +25,6 @@ class ExtractSliceOp;
2725} // namespace tensor
2826
2927namespace linalg {
30- class LinalgDependenceGraph ;
3128
3229// ===----------------------------------------------------------------------===//
3330// General utilities
@@ -153,19 +150,6 @@ enum class LinalgTilingLoopType {
153150 ParallelLoops = 2
154151};
155152
156- // / Checks whether the specific `producer` is the last write to exactly the
157- // / whole `consumedView`. This checks structural dominance, that the dependence
158- // / is a RAW without any interleaved write to any piece of `consumedView`.
159- bool isProducerLastWriteOfView (const LinalgDependenceGraph &graph,
160- LinalgOp consumer, Value consumedView,
161- LinalgOp producer);
162-
163- // / Checks whether fusing the specific `producer` of the `consumedView` is
164- // / feasible. This checks `producer` is the last write of `consumedView` and
165- // / that no interleaved dependence would be violated (RAW, WAR or WAW).
166- bool isFusableInto (const LinalgDependenceGraph &graph, LinalgOp consumer,
167- Value consumedView, LinalgOp producer);
168-
169153// / Computes tile offsets, given a list of loop `ivs` and `tileSizes`. In case a
170154// / tile size is zero (i.e., no tiling), the corresponding offset is also zero.
171155SmallVector<OpFoldResult> computeTileOffsets (OpBuilder &b, Location loc,
@@ -268,13 +252,6 @@ void offsetIndices(OpBuilder &b, LinalgOp linalgOp,
268252void offsetIndices (RewriterBase &b, LinalgOp linalgOp,
269253 ArrayRef<OpFoldResult> offests);
270254
271- using FusableOpDependencesTy = llvm::MapVector<
272- Operation *,
273- SmallVector<LinalgDependenceGraph::LinalgDependenceGraphElem, 1 >>;
274- FusableOpDependencesTy
275- findAllFusableDependences (ArrayRef<LinalgOp> ops,
276- const LinalgDependenceGraph &dependenceGraph);
277-
278255// / A struct containing the Linalg producer before and after fusion.
279256// / When operating on tensors, `fusedProducer` may feed into a `tensor.cast` op
280257// / before the consumer Linalg op, until enough canonicalizations have applied.
@@ -283,14 +260,6 @@ struct FusionInfo {
283260 LinalgOp fusedProducer;
284261};
285262
286- // / Fuses producer into consumer if the producer is structurally feasible and
287- // / the fusion would not violate dependencies.
288- // / Implements the fusion part of the "tileAndFuse on buffers" transformation
289- // / and thus requires the `consumerOpOperand` to be a `subview` op (generally
290- // / obtained by applying the tiling transformation).
291- FailureOr<FusionInfo> fuseProducerOfBuffer (OpBuilder &b,
292- OpOperand &consumerOpOperand,
293- const LinalgDependenceGraph &graph);
294263// / Tensor counterpart of `fuseProducerOfBuffer`.
295264// / This implements the fusion part of the "tileAndFuse on tensors"
296265// / transformation and thus requires the `consumerOpOperand` to be a
0 commit comments