[Mlir-commits] [mlir] 633ad1d - [mlir:MultiOpDriver] Quick fix the assertion position
Chia-hung Duan
llvmlistbot at llvm.org
Thu Jun 2 16:27:22 PDT 2022
Author: Chia-hung Duan
Date: 2022-06-02T23:25:35Z
New Revision: 633ad1d864c807c7904419c80394231bd5c46ddf
URL: https://github.com/llvm/llvm-project/commit/633ad1d864c807c7904419c80394231bd5c46ddf
DIFF: https://github.com/llvm/llvm-project/commit/633ad1d864c807c7904419c80394231bd5c46ddf.diff
LOG: [mlir:MultiOpDriver] Quick fix the assertion position
The assertion should come after null check
Added:
Modified:
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
index be7924e153088..7697e603507a4 100644
--- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
@@ -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);
More information about the Mlir-commits
mailing list