We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65a5b18 commit 9825d1fCopy full SHA for 9825d1f
mlir/lib/Dialect/PDL/IR/PDL.cpp
@@ -65,13 +65,10 @@ static void visit(Operation *op, DenseSet<Operation *> &visited) {
65
if (!isa<PatternOp>(op->getParentOp()) || isa<RewriteOp>(op))
66
return;
67
68
- // Ignore if already visited.
69
- if (visited.contains(op))
+ // Ignore if already visited. Otherwise, mark as visited.
+ if (!visited.insert(op).second)
70
71
72
- // Mark as visited.
73
- visited.insert(op);
74
-
75
// Traverse the operands / parent.
76
TypeSwitch<Operation *>(op)
77
.Case<OperationOp>([&visited](auto operation) {
0 commit comments