[Mlir-commits] [mlir] [mlir][tensor] Implement folding logic for size 0 tensor and memref ops (PR #90814)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed May 1 19:40:35 PDT 2024
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 a7e07988549c79d9bfecec3e630141fff61f52f0 5ed96f68e63c4f8de69563693ffe28a557301217 -- mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
index 675aeacd8f..cf3f9388f2 100644
--- a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
+++ b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
@@ -839,11 +839,11 @@ struct FoldEmptyCopy final : public OpRewritePattern<CopyOp> {
static bool isEmptyMemRef(BaseMemRefType type) {
return type.hasRank() &&
- llvm::any_of(type.getShape(), [](int64_t x) { return x == 0; });
+ llvm::any_of(type.getShape(), [](int64_t x) { return x == 0; });
}
LogicalResult matchAndRewrite(CopyOp copyOp,
- PatternRewriter& rewriter) const override {
+ PatternRewriter &rewriter) const override {
if (isEmptyMemRef(copyOp.getSource().getType()) ||
isEmptyMemRef(copyOp.getTarget().getType())) {
rewriter.eraseOp(copyOp);
``````````
</details>
https://github.com/llvm/llvm-project/pull/90814
More information about the Mlir-commits
mailing list