[Mlir-commits] [mlir] ac38a7d - [MLIR] Fix incorrect assertion in memref replacement utility
Uday Bondhugula
llvmlistbot at llvm.org
Fri Nov 18 23:05:50 PST 2022
Author: Uday Bondhugula
Date: 2022-11-19T12:34:27+05:30
New Revision: ac38a7d3524733bee3901d2d8ea20ad664bbb7fc
URL: https://github.com/llvm/llvm-project/commit/ac38a7d3524733bee3901d2d8ea20ad664bbb7fc
DIFF: https://github.com/llvm/llvm-project/commit/ac38a7d3524733bee3901d2d8ea20ad664bbb7fc.diff
LOG: [MLIR] Fix incorrect assertion in memref replacement utility
The assertion had an unchecked use of getDefiningOp. The condition
itself is stale and not needed. This is a trivial/obvious fix - the
buggy path wasn't exercised since the current passes/users of this
utility always passed the result of an op as an "extra index".
Differential Revision: https://reviews.llvm.org/D138191
Added:
Modified:
mlir/lib/Dialect/Affine/Utils/Utils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Affine/Utils/Utils.cpp b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
index 9f074a488b4a..2d4ecc85bef7 100644
--- a/mlir/lib/Dialect/Affine/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
@@ -1199,8 +1199,6 @@ LogicalResult mlir::replaceAllMemRefUsesWith(Value oldMemRef, Value newMemRef,
// Prepend 'extraIndices' in 'newMapOperands'.
for (Value extraIndex : extraIndices) {
- assert(extraIndex.getDefiningOp()->getNumResults() == 1 &&
- "single result op's expected to generate these indices");
assert((isValidDim(extraIndex) || isValidSymbol(extraIndex)) &&
"invalid memory op index");
newMapOperands.push_back(extraIndex);
More information about the Mlir-commits
mailing list