[Mlir-commits] [mlir] 04a66f8 - Fixing vector add pattern that incorrectly returns success.
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Sep 16 15:09:54 PDT 2021
Author: MaheshRavishankar
Date: 2021-09-16T14:48:09-07:00
New Revision: 04a66f8d2b8f3dfba32ba3f7652dbeb3427a3df4
URL: https://github.com/llvm/llvm-project/commit/04a66f8d2b8f3dfba32ba3f7652dbeb3427a3df4
DIFF: https://github.com/llvm/llvm-project/commit/04a66f8d2b8f3dfba32ba3f7652dbeb3427a3df4.diff
LOG: Fixing vector add pattern that incorrectly returns success.
The pattern is returning success even if it does no work leading to pattern application running up to the max iteration count and failing.
Reviewed By: nicolasvasilache, mravishankar
Differential Revision: https://reviews.llvm.org/D109791
Added:
Modified:
mlir/lib/Dialect/Vector/VectorOps.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Vector/VectorOps.cpp b/mlir/lib/Dialect/Vector/VectorOps.cpp
index 40741fa4d9d0e..0b8f0efc16b02 100644
--- a/mlir/lib/Dialect/Vector/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/VectorOps.cpp
@@ -793,7 +793,7 @@ struct CanonicalizeContractAdd : public OpRewritePattern<AddOpType> {
Value a = addOp->getOperand(0), b = addOp->getOperand(1);
vector::ContractionOp contract = canonicalize(a, b);
contract = contract ? contract : canonicalize(b, a);
- return success();
+ return contract ? success() : failure();
}
};
More information about the Mlir-commits
mailing list