Skip to content

Commit f6017da

Browse files
meg-guptaCatfish-Man
authored andcommitted
Address review comments from swiftlang#68150
1 parent 833f912 commit f6017da

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ private func shouldInline(apply: FullApplySite, callee: Function, alreadyInlined
167167
return true
168168
}
169169

170-
if apply.parentFunction.hasOwnership && !callee.hasOwnership {
171-
// Cannot inline a non-ossa function into an ossa function
172-
return false
173-
}
174-
175170
if apply is BeginApplyInst {
176171
// Avoid co-routines because they might allocate (their context).
177172
return true

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,14 @@ extension FullApplySite {
510510
!calleeFunction.isSerialized {
511511
return false
512512
}
513+
514+
// Cannot inline a non-ossa function into an ossa function
515+
if parentFunction.hasOwnership,
516+
let calleeFunction = referencedFunction,
517+
!calleeFunction.hasOwnership {
518+
return false
519+
}
520+
513521
return true
514522
}
515523

0 commit comments

Comments
 (0)