forked from OSchip/llvm-project
Check if the operation is already in the worklist before adding it.
PiperOrigin-RevId: 225379496
This commit is contained in:
parent
4860f0e8fd
commit
5c4f1fdd42
|
@ -40,6 +40,10 @@ public:
|
|||
void simplifyFunction(Function *currentFunction, WorklistRewriter &rewriter);
|
||||
|
||||
void addToWorklist(Operation *op) {
|
||||
// Check to see if the worklist already contains this op.
|
||||
if (worklistMap.count(op))
|
||||
return;
|
||||
|
||||
worklistMap[op] = worklist.size();
|
||||
worklist.push_back(op);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue