Skip to content

Commit 5b6918f

Browse files
authored
Merge pull request swiftlang#32505 from gottesmm/pr-12b4fd6015e37d9a95ea6a81da117e6678369d02
[ownership] Split ownership lowering in the pass pipeline for non-transparent stdlib vs non-stdlib functions.
2 parents 493a4a2 + 3530f8e commit 5b6918f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,17 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
436436
// not blocked by any other passes' optimizations, so do it early.
437437
P.addDifferentiabilityWitnessDevirtualizer();
438438

439-
// Strip ownership from non-transparent functions.
439+
// Strip ownership from non-transparent functions when we are not compiling
440+
// the stdlib module. When compiling the stdlib, we eliminate ownership on
441+
// these functions later with a nromal call to
442+
// P.addNonTransparentFunctionOwnershipModelEliminator().
443+
//
444+
// This is done so we can push ownership through the pass pipeline first for
445+
// the stdlib and then everything else.
446+
P.addNonStdlibNonTransparentFunctionOwnershipModelEliminator();
447+
448+
// We earlier eliminated ownership if we are not compiling the stdlib. Now
449+
// handle the stdlib functions.
440450
P.addNonTransparentFunctionOwnershipModelEliminator();
441451

442452
// Start by linking in referenced functions from other modules.

0 commit comments

Comments
 (0)