[Mlir-commits] [mlir] [mlir][linalg] Bail out tensor.cast pack/unpack fold on unprovable tile sizes (PR #188000)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Mar 23 02:16:50 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 95aeb821c..5b75be21e 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -6486,7 +6486,8 @@ struct FoldTensorCastUnPackOp : public OpRewritePattern<UnPackOp> {
// Get the updated mixed-tile-sizes attribute.
FailureOr<SmallVector<OpFoldResult>> newMixedTileSizes =
- getNewMixedTileSizes(rewriter, sourceTensor.getType(), op.getMixedTiles());
+ getNewMixedTileSizes(rewriter, sourceTensor.getType(),
+ op.getMixedTiles());
if (failed(newMixedTileSizes))
return rewriter.notifyMatchFailure(
op, "unable to prove dynamic tile sizes after folding tensor.cast");
@@ -6495,10 +6496,9 @@ struct FoldTensorCastUnPackOp : public OpRewritePattern<UnPackOp> {
// TODO: Strictly speaking, discardable attributes should be _discarded_ at
// this point. However, in practice, we use them for things that we'd like
// to preserve. Implement a better abstraction.
- UnPackOp newOp =
- UnPackOp::create(rewriter, op.getLoc(), sourceTensor, newOperands[1],
- op.getInnerDimsPos(), newMixedTileSizes.value(),
- op.getOuterDimsPerm());
+ UnPackOp newOp = UnPackOp::create(
+ rewriter, op.getLoc(), sourceTensor, newOperands[1],
+ op.getInnerDimsPos(), newMixedTileSizes.value(), op.getOuterDimsPerm());
newOp->setDiscardableAttrs(op->getDiscardableAttrDictionary());
// Replace op.
``````````
</details>
https://github.com/llvm/llvm-project/pull/188000
More information about the Mlir-commits
mailing list