Begin unbundling devirtualization, specialization, and inlining by
recreating the stand-alone generic specializer pass.
I've added a use of the pass to the pipeline, but this is almost
certainly not going to be the final location of where it runs. It's
primarily there to ensure this code gets exercised.
Since this is running prior to inlining, it changes the order that some
functions are specialized in, which means differences in the order of
output of one of the tests (one which similarly changed when
devirtualization, specialization, and inlining were bundled together).
Add interfaces and update the pass execution logic to allow function
passes to create new functions, or ask for functions to be optimized
prior to continuing.
Doing so results in the pass pipeline halting execution on the current
function, and continuing with newly added functions, returning to the
previous function after the newly added functions are fully optimized.
Make it a std::vector that reserves enough space based on the number of
functions in the initial bottom-up ordering.
This is the first step in making it possible for function passes to
notify the pass manager of new functions to process.
Make it a bit more clear that we're alternating between collecting (and
then running) function passes, and running module passes. Removes some
duplication that was present.
Reapplies 9d4d3c8 with fixes for bisecting pass execution.
This reverts commit 9d4d3c8055.
I forgot to finish up changes required to make -Xllvm
-sil-opt-pass-count continue working the way it did, so I'll back that
out until I have those changes as well.
Make it a bit more clear that we're alternating between collecting (and
then running) function passes, and running module passes. Removes some
duplication that was present.
Rather than iterating over an array of functions, build a work list and
pop functions off of it.
This is a small step towards allowing function passes to create new
functions to be processed.
(libraries now)
It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.
This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.
Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.