Skip to content

Commit b7aaad7

Browse files
authored
Merge pull request #30073 from gottesmm/pr-2049c5667508c622325a30f14e18b0c78bb850bf
[ownership] Move TempRValueOpt before Semantic ARC Opts.
2 parents 71fc5bd + d1b41e9 commit b7aaad7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,21 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
395395
// we do not spend time optimizing them.
396396
P.addDeadFunctionElimination();
397397

398+
// Cleanup after SILGen: remove trivial copies to temporaries.
399+
P.addTempRValueOpt();
400+
// Cleanup after SILGen: remove unneeded borrows/copies.
398401
P.addSemanticARCOpts();
399402

400403
// Strip ownership from non-transparent functions.
401404
if (P.getOptions().StripOwnershipAfterSerialization)
402405
P.addNonTransparentFunctionOwnershipModelEliminator();
403406

404-
// Start by cloning functions from stdlib.
407+
// Start by linking in referenced functions from other modules.
405408
P.addPerformanceSILLinker();
406409

407-
// Cleanup after SILGen: remove trivial copies to temporaries.
410+
// Cleanup after SILGen: remove trivial copies to temporaries. This version of
411+
// temp-rvalue opt is here so that we can hit copies from non-ossa code that
412+
// is linked in from the stdlib.
408413
P.addTempRValueOpt();
409414

410415
// Add the outliner pass (Osize).

0 commit comments

Comments
 (0)