Skip to content

Commit 3530f8e

Browse files
committed
[ownership] Split ownership lowering in the pass pipeline for non-transparent stdlib vs non-stdlib functions.
I am going to be moving back ownership lowering first in the stdlib so that we can bring up the optimizer on ownership without needing to deal with serialization issues (the stdlib doesn't deserialize SIL from any other modules). This patch just begins the mechanical process with a nice commit message. Should be NFC.
1 parent 1d4f617 commit 3530f8e

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)