mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Reapply r23982, which moves mandatory inlining after DI and inout deshadowing.
This fixes some serious DI problems where it would be broken with transparent functions like ++. Previously, this had to be reverted because we were relying on mandatory inlining to inline closure-taking stdlib functions (like &&/||) before inout deshadowing happened. With mandatory inlining moved after inout deshadowing, we were getting a lot of inout shadow temporaries around, which notably defeated important COW optimizations by increasing refcounts in unpredictable ways. The new @__noescape attribute handles this for us now, because @__noescape closures (like the autoclosure arguments to ||/&&) no longer block inout deshadowing. Swift SVN r24142
This commit is contained in:
@@ -75,8 +75,8 @@ bool swift::runSILDiagnosticPasses(SILModule &Module) {
|
||||
// If we are asked do debug serialization, instead of running all diagnostic
|
||||
// passes, just run mandatory inlining with dead transparent function cleanup
|
||||
// disabled.
|
||||
PM.add(createMandatoryInlining());
|
||||
if (Module.getOptions().DebugSerialization) {
|
||||
PM.add(createMandatoryInlining());
|
||||
PM.run();
|
||||
return Ctx.hadError();
|
||||
}
|
||||
@@ -87,6 +87,8 @@ bool swift::runSILDiagnosticPasses(SILModule &Module) {
|
||||
PM.add(createInOutDeshadowing());
|
||||
PM.add(createNoReturnFolding());
|
||||
PM.add(createDefiniteInitialization());
|
||||
|
||||
PM.add(createMandatoryInlining());
|
||||
PM.add(createPredictableMemoryOptimizations());
|
||||
PM.add(createDiagnosticConstantPropagation());
|
||||
PM.add(createDiagnoseUnreachable());
|
||||
|
||||
Reference in New Issue
Block a user