Skip to content

Commit c844f8d

Browse files
Use more efficient algorithm to calculate dominators
Use Lengauer&Tarjan's algorithm to calculate the tree of immediate dominators instead of the previous algorithm, which gives us a significant performance improvement. Also, instead of storing the dominators in a std::set we now just store the immediate dominators and make lookups in there instead. This is a significant performance improvement as long as the dominators set are only iterated over or only queried infrequently, as is currently the case, and also saves a lot of memory in the case of large functions (previous memory usage was quadratic with function size, now it is linear). In cases where a lot of queries are made against the same set of dominators, they can still be copied to a local std::set prior to that.
1 parent f17e2c8 commit c844f8d

File tree

2 files changed

+485
-98
lines changed

2 files changed

+485
-98
lines changed

0 commit comments

Comments
 (0)