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 tensorflow/mlir#211

PiperOrigin-RevId: 277319669
This commit is contained in:
Diego Caballero 2019-10-29 10:57:56 -07:00 committed by A. Unique TensorFlower
parent 8656af1e82
commit c87c7f5732
1 changed files with 1 additions and 0 deletions

View File

@ -79,6 +79,7 @@ public:
if (it != worklistMap.end()) {
assert(worklist[it->second] == op && "malformed worklist data structure");
worklist[it->second] = nullptr;
worklistMap.erase(it);
}
}