Skip to content

Commit

Permalink
Bugfix: Keep worklistMap in sync with worklist in GreedyPatternRewriter
Browse files Browse the repository at this point in the history
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
Change-Id: I4d919ea19eb5ef229b1ee001ddd26faba26e6879
  • Loading branch information
dcaballe authored and tensorflower-gardener committed Oct 29, 2019
1 parent 46775c4 commit ec78373
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class GreedyPatternRewriteDriver : public PatternRewriter {
if (it != worklistMap.end()) {
assert(worklist[it->second] == op && "malformed worklist data structure");
worklist[it->second] = nullptr;
worklistMap.erase(it);
}
}

Expand Down

0 comments on commit ec78373

Please sign in to comment.