mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILCombine: limit the worklist size for instruction canonicalization
To be precise: don't add instruction uses to the worklist if it already has more than 10000 elements. This avoids quadratic behavior for very large functions. rdar://problem/56268570
This commit is contained in:
@@ -131,7 +131,9 @@ public:
|
||||
}
|
||||
|
||||
void notifyHasNewUsers(SILValue value) override {
|
||||
Worklist.addUsersToWorklist(value);
|
||||
if (Worklist.size() < 10000) {
|
||||
Worklist.addUsersToWorklist(value);
|
||||
}
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user