-
Notifications
You must be signed in to change notification settings - Fork 830
Open
Labels
Description
src/ir/local-graph.h is fairly slow, and we should make it faster. If it were fast enough, we could enable precompute-propagate and merge-locals in more optimization levels, which would improve code output quality.
What LocalGraph does is scan a function and produce a mapping of the sets affecting each get. That is, for each get, the sets that reach that get, that their assigned value may be read there.
This is similar to SSA computation in a way, but simpler (no need to create phis), and there are fairly fast SSA computations on structured control flow like ours, so it seems like this could be fairly fast. Right now the implementation naively carries around big data structures needlessly.