From 4c8d09feb3e527569ea9c5ba026bb7ea59138c14 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Wed, 30 Sep 2020 16:08:06 -0500 Subject: [PATCH] [ownership] Move ownership lowering past SROA. I already updated SROA for this and we already have tests/etc. We have just been waiting on some other passes to be moved afterwards. --- lib/SILOptimizer/PassManager/PassPipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/SILOptimizer/PassManager/PassPipeline.cpp b/lib/SILOptimizer/PassManager/PassPipeline.cpp index 4a17701499818..2c81d1bbcb646 100644 --- a/lib/SILOptimizer/PassManager/PassPipeline.cpp +++ b/lib/SILOptimizer/PassManager/PassPipeline.cpp @@ -289,10 +289,6 @@ void addFunctionPasses(SILPassPipelinePlan &P, // Split up opaque operations (copy_addr, retain_value, etc.). P.addLowerAggregateInstrs(); - // We earlier eliminated ownership if we are not compiling the stdlib. Now - // handle the stdlib functions. - P.addNonTransparentFunctionOwnershipModelEliminator(); - // Split up operations on stack-allocated aggregates (struct, tuple). if (OpLevel == OptimizationLevelKind::HighLevel) { P.addEarlySROA(); @@ -300,6 +296,10 @@ void addFunctionPasses(SILPassPipelinePlan &P, P.addSROA(); } + // We earlier eliminated ownership if we are not compiling the stdlib. Now + // handle the stdlib functions. + P.addNonTransparentFunctionOwnershipModelEliminator(); + // Promote stack allocations to values. P.addMem2Reg();