Skip to content

Commit 9dbf7cc

Browse files
committed
Address review comments from swiftlang#68150
1 parent 79c8f5d commit 9dbf7cc

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

0 commit comments

Comments
 (0)