Skip to content

Commit

Permalink
[mlir:MultiOpDriver] Quick fix the assertion position
Browse files Browse the repository at this point in the history
The assertion should come after null check
  • Loading branch information
ChiaHungDuan committed Jun 2, 2022
1 parent 987f9cb commit 633ad1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
Expand Up @@ -607,14 +607,15 @@ bool MultiOpPatternRewriteDriver::simplifyLocally(ArrayRef<Operation *> ops) {
SmallVector<Value, 8> originalOperands, resultValues;
while (!worklist.empty()) {
Operation *op = popFromWorklist();
assert((!strictMode || strictModeFilteredOps.contains(op)) &&
"unexpected op was inserted under strict mode");

// Nulls get added to the worklist when operations are removed, ignore
// them.
if (op == nullptr)
continue;

assert((!strictMode || strictModeFilteredOps.contains(op)) &&
"unexpected op was inserted under strict mode");

// If the operation is trivially dead - remove it.
if (isOpTriviallyDead(op)) {
notifyOperationRemoved(op);
Expand Down

0 comments on commit 633ad1d

Please sign in to comment.