mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user