File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,12 @@ bool SILPerformanceInliner::isProfitableToInline(
262
262
int BaseBenefit = RemovedCallBenefit;
263
263
264
264
// Osize heuristic.
265
+ //
266
+ // As a hack, don't apply this at all to coroutine inlining; avoiding
267
+ // coroutine allocation overheads is extremely valuable. There might be
268
+ // more principled ways of getting this effect.
265
269
bool isClassMethodAtOsize = false ;
266
- if (OptMode == OptimizationMode::ForSize) {
270
+ if (OptMode == OptimizationMode::ForSize && !isa<BeginApplyInst>(AI) ) {
267
271
// Don't inline into thunks.
268
272
if (AI.getFunction ()->isThunk ())
269
273
return false ;
Original file line number Diff line number Diff line change @@ -151,16 +151,17 @@ extension UnsafeMutableAudioBufferListPointer
151
151
}
152
152
153
153
/// Access an indexed `AudioBuffer` (`mBuffers[i]`).
154
+ @_borrowed
154
155
public subscript( index: Index ) -> Element {
155
- get {
156
+ _read {
156
157
precondition ( index >= 0 && index < self . count,
157
158
" subscript index out of range " )
158
- return ( _audioBuffersPointer + index) . pointee
159
+ yield ( ( _audioBuffersPointer + index) . pointee)
159
160
}
160
- nonmutating set ( newValue ) {
161
+ nonmutating _modify {
161
162
precondition ( index >= 0 && index < self . count,
162
163
" subscript index out of range " )
163
- ( _audioBuffersPointer + index) . pointee = newValue
164
+ yield ( & ( _audioBuffersPointer + index) . pointee)
164
165
}
165
166
}
166
167
}
Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ public protocol Collection: Sequence {
414
414
/// `endIndex` property.
415
415
///
416
416
/// - Complexity: O(1)
417
+ @_borrowed
417
418
subscript( position: Index) -> Element { get }
418
419
419
420
/// Accesses a contiguous subrange of the collection's elements.
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ where SubSequence: MutableCollection
85
85
/// `endIndex` property.
86
86
///
87
87
/// - Complexity: O(1)
88
+ @_borrowed
88
89
override subscript( position: Index ) -> Element { get set }
89
90
90
91
/// Accesses a contiguous subrange of the collection's elements.
You can’t perform that action at this time.
0 commit comments