Skip to content

Commit 0975552

Browse files
committed
Fix comment
1 parent e740f93 commit 0975552

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,14 @@ FailureOr<LowerPackResult> linalg::lowerPack(RewriterBase &rewriter,
345345
}
346346

347347
// 4. Expand from the padded result to the stripMinedShape.
348-
// Check if any dims are not factorable. A dim is factorable if the expansion
349-
// requires at most dynamnic dim
350-
RankedTensorType expandDestType = RankedTensorType::Builder(packedTensorType).setShape(stripMinedShape);
348+
RankedTensorType expandDestType =
349+
RankedTensorType::Builder(packedTensorType).setShape(stripMinedShape);
351350
SmallVector<int64_t> transpPerm =
352351
invertPermutationVector(packedToStripMinedShapePerm);
353352
Operation *reshapeOp;
353+
// Check if any dims are not factorable and thus need a `tensor.reshape`
354+
// instead of a `tensor.expand_shape` op. A dim is factorable if the expansion
355+
// requires at most dynamnic dim
354356
if (llvm::any_of(packingMetadata.reassociations,
355357
[&](const auto &rAssoc) -> bool {
356358
return llvm::count_if(rAssoc, [&](int64_t r) {
@@ -360,7 +362,8 @@ FailureOr<LowerPackResult> linalg::lowerPack(RewriterBase &rewriter,
360362
SmallVector<OpFoldResult> sizes =
361363
tensor::getMixedSizes(rewriter, loc, packOp.getDest());
362364
applyPermutationToVector(sizes, transpPerm);
363-
// Create a `tensor` of `index` types for the `shape` operand of `tensor.reshape`
365+
// Create a `tensor` of `index` types for the `shape` operand of
366+
// `tensor.reshape`
364367
Value shapeInitTensor = rewriter.create<tensor::EmptyOp>(
365368
loc,
366369
RankedTensorType::get({expandDestType.getRank()},

0 commit comments

Comments
 (0)