Skip to content

Commit c9b50e7

Browse files
committed
Address review comments from swiftlang#68150
1 parent e5037c3 commit c9b50e7

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
@@ -466,6 +466,14 @@ extension FullApplySite {
466466
!calleeFunction.isSerialized {
467467
return false
468468
}
469+
470+
// Cannot inline a non-ossa function into an ossa function
471+
if parentFunction.hasOwnership,
472+
let calleeFunction = referencedFunction,
473+
!calleeFunction.hasOwnership {
474+
return false
475+
}
476+
469477
return true
470478
}
471479

0 commit comments

Comments
 (0)