Skip to content

Commit 5bea3d6

Browse files
committed
Address review comments from swiftlang#68150
1 parent 2239e37 commit 5bea3d6

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
@@ -497,6 +497,14 @@ extension FullApplySite {
497497
!calleeFunction.isSerialized {
498498
return false
499499
}
500+
501+
// Cannot inline a non-ossa function into an ossa function
502+
if parentFunction.hasOwnership,
503+
let calleeFunction = referencedFunction,
504+
!calleeFunction.hasOwnership {
505+
return false
506+
}
507+
500508
return true
501509
}
502510

0 commit comments

Comments
 (0)