mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Optimizer: extract the NamedReturnValueOptimization from CopyForwarding to a separate function pass
This allows to run the NamedReturnValueOptimization only late in the pipeline. The optimization shouldn't be done before serialization, because it might prevent predictable memory optimizations in the caller after inlining.
This commit is contained in:
@@ -758,6 +758,10 @@ static void addLowLevelPassPipeline(SILPassPipelinePlan &P) {
|
||||
|
||||
addFunctionPasses(P, OptimizationLevelKind::LowLevel);
|
||||
|
||||
// The NamedReturnValueOptimization shouldn't be done before serialization.
|
||||
// For details see the comment for `namedReturnValueOptimization`.
|
||||
P.addNamedReturnValueOptimization();
|
||||
|
||||
P.addDeadObjectElimination();
|
||||
P.addObjectOutliner();
|
||||
P.addDeadStoreElimination();
|
||||
|
||||
Reference in New Issue
Block a user