diff --git a/lib/SILOptimizer/PassManager/PassPipeline.cpp b/lib/SILOptimizer/PassManager/PassPipeline.cpp index 8c02e3d911706..d2285a1620244 100644 --- a/lib/SILOptimizer/PassManager/PassPipeline.cpp +++ b/lib/SILOptimizer/PassManager/PassPipeline.cpp @@ -445,10 +445,6 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) { // the stdlib and then everything else. P.addNonStdlibNonTransparentFunctionOwnershipModelEliminator(); - // We earlier eliminated ownership if we are not compiling the stdlib. Now - // handle the stdlib functions. - P.addNonTransparentFunctionOwnershipModelEliminator(); - // Start by linking in referenced functions from other modules. P.addPerformanceSILLinker(); @@ -457,6 +453,10 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) { // is linked in from the stdlib. P.addTempRValueOpt(); + // We earlier eliminated ownership if we are not compiling the stdlib. Now + // handle the stdlib functions. + P.addNonTransparentFunctionOwnershipModelEliminator(); + // Needed to serialize static initializers of globals for cross-module // optimization. P.addGlobalOpt();