Skip to content

Commit d91fed8

Browse files
committed
Address review comments from swiftlang#68150
1 parent bbb4b00 commit d91fed8

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
@@ -157,11 +157,6 @@ private func shouldInline(apply: FullApplySite, callee: Function, alreadyInlined
157157
return true
158158
}
159159

160-
if apply.parentFunction.hasOwnership && !callee.hasOwnership {
161-
// Cannot inline a non-ossa function into an ossa function
162-
return false
163-
}
164-
165160
if apply is BeginApplyInst {
166161
// Avoid co-routines because they might allocate (their context).
167162
return true

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,14 @@ extension FullApplySite {
479479
!calleeFunction.isSerialized {
480480
return false
481481
}
482+
483+
// Cannot inline a non-ossa function into an ossa function
484+
if parentFunction.hasOwnership,
485+
let calleeFunction = referencedFunction,
486+
!calleeFunction.hasOwnership {
487+
return false
488+
}
489+
482490
return true
483491
}
484492

0 commit comments

Comments
 (0)