Add a stand-alone generic specializer pass.

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).
This commit is contained in:
Mark Lacey
2015-12-14 13:04:42 -08:00
parent dbde7cc4c1
commit faba6e56b7
8 changed files with 227 additions and 109 deletions

View File

@@ -277,16 +277,12 @@ void SILPassManager::runFunctionPasses(PassList FuncTransforms) {
runPassesOnFunction(FuncTransforms, F);
++CountOptimized[F];
// We currently have no function passes that generate new
// functions, so confirm that we only optimize a given function
// once.
assert(CountOptimized[F] == 1 && "Expected function to be optimized once!");
// If running the function transforms did not result in new
// functions being added to the top of the worklist, then we're
// done with this function and can pop it off and
// continue. Otherwise, we'll return to this function and
// reoptimize after processing the new function that were added.
// done with this function and can pop it off and continue.
// Otherwise, we'll return to this function and reoptimize after
// processing the new functions that were added.
if (F == FunctionWorklist.back())
FunctionWorklist.pop_back();
}