Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 7619c29

Browse files
dcaballetensorflower-gardener
authored andcommitted
Bugfix: Keep worklistMap in sync with worklist in GreedyPatternRewriter
When we removed a pattern, we removed it from worklist but not from worklistMap. Then, when we tried to add a new pattern on the same Operation again, the pattern wasn't added since it already existed in the worklistMap (but not in the worklist). Closes #211 PiperOrigin-RevId: 277319669
1 parent e6d8471 commit 7619c29

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class GreedyPatternRewriteDriver : public PatternRewriter {
7979
if (it != worklistMap.end()) {
8080
assert(worklist[it->second] == op && "malformed worklist data structure");
8181
worklist[it->second] = nullptr;
82+
worklistMap.erase(it);
8283
}
8384
}
8485

0 commit comments

Comments
 (0)