[Mlir-commits] [mlir] [mlir][tensor] move tensor insert canonicalization to pattern (PR #142671)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jun 3 15:10:27 PDT 2025
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 HEAD~1 HEAD --extensions cpp,h -- mlir/include/mlir/Dialect/Tensor/IR/Tensor.h mlir/lib/Dialect/Tensor/IR/TensorOps.cpp mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
index f0ee1d33d..d8f1090b4 100644
--- a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
+++ b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
@@ -1674,7 +1674,8 @@ public:
// Update the attribute at the inserted index.
auto sourceValues = sourceAttr.getValues<Attribute>();
auto flattenedIndex = sourceAttr.getFlattenedIndex(indices);
- SmallVector<Attribute> updatedValues{sourceValues.begin(), sourceValues.end()};
+ SmallVector<Attribute> updatedValues{sourceValues.begin(),
+ sourceValues.end()};
updatedValues[flattenedIndex] = scalarAttr;
rewriter.replaceOpWithNewOp<arith::ConstantOp>(
insertOp, sourceAttr.getType(),
``````````
</details>
https://github.com/llvm/llvm-project/pull/142671
More information about the Mlir-commits
mailing list