|
27 | 27 | #include "mlir/Dialect/Vector/IR/VectorOps.h"
|
28 | 28 | #include "mlir/IR/AffineExpr.h"
|
29 | 29 | #include "mlir/IR/Matchers.h"
|
30 |
| -#include "mlir/IR/PatternMatch.h" |
31 | 30 | #include "mlir/Pass/Pass.h"
|
32 | 31 | #include "mlir/Support/LLVM.h"
|
33 | 32 | #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
|
@@ -1194,27 +1193,27 @@ LogicalResult GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(
|
1194 | 1193 | // 2. Transpose the tile to match the inner tile order:
|
1195 | 1194 | // %init = tensor.empty()
|
1196 | 1195 | // %transposed_tile = linalg.transpose ins(%extracted_tile), outs(%init)
|
1197 |
| - // NOTE: Outer dims are 1 and hence effectively ignored. |
| 1196 | + // NOTE: Outer dims are 1 and hence effectively ignored. |
1198 | 1197 | SmallVector<int64_t> perm = getPackUnpackRankReducedPerm(
|
1199 | 1198 | inputShape, packOp.getInnerDimsPos(), packOp.getOuterDimsPerm());
|
1200 | 1199 |
|
1201 | 1200 | LLVM_DEBUG(DBGS() << "Pack permutation: " << packOp << "\n";
|
1202 | 1201 | llvm::interleaveComma(perm, DBGS() << "perm: "); DBGSNL(););
|
1203 | 1202 |
|
1204 | 1203 | // 2.1 Create tensor.empty (init value for TransposeOp)
|
1205 |
| - SmallVector<OpFoldResult> transShapeForEmptyOpDynamic; |
| 1204 | + SmallVector<OpFoldResult> transShapeForEmptyOp; |
1206 | 1205 |
|
1207 | 1206 | // Acquire tensor shape required to create EmptyOp. This will match the inner
|
1208 | 1207 | // tile sizes.
|
1209 | 1208 | size_t idx = numTiles;
|
1210 | 1209 | while (idx != 0) {
|
1211 |
| - transShapeForEmptyOpDynamic.push_back(extractSliceSizes[srcRank - idx]); |
| 1210 | + transShapeForEmptyOp.push_back(extractSliceSizes[srcRank - idx]); |
1212 | 1211 | idx--;
|
1213 | 1212 | }
|
1214 | 1213 |
|
1215 |
| - applyPermutationToVector<OpFoldResult>(transShapeForEmptyOpDynamic, perm); |
1216 |
| - Value empty = rewriter.create<tensor::EmptyOp>( |
1217 |
| - loc, transShapeForEmptyOpDynamic, elemType); |
| 1214 | + applyPermutationToVector<OpFoldResult>(transShapeForEmptyOp, perm); |
| 1215 | + Value empty = |
| 1216 | + rewriter.create<tensor::EmptyOp>(loc, transShapeForEmptyOp, elemType); |
1218 | 1217 |
|
1219 | 1218 | // 2.2 Create linalg.transpose
|
1220 | 1219 | auto transposedOp =
|
|
0 commit comments