Skip to content

Commit

Permalink
[MLIR] Fix incorrect assertion in memref replacement utility
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bondhugula committed Nov 19, 2022
1 parent 0e4378c commit ac38a7d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Affine/Utils/Utils.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit ac38a7d

Please sign in to comment.