Skip to content

Support @noescape SIL function types. #12420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 17, 2017
Merged

Support @noescape SIL function types. #12420

merged 23 commits into from
Oct 17, 2017

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Oct 13, 2017

These are the underlying SIL changes necessary to implement the new
closure capture ABI.

Note: This includes a change to function name mangling that
primarily affects reabstraction thunks.

The new ABI will allow stack allocation of non-escaping closures as a
simple optimization.

The new ABI, and the stack allocation optimization, also require
closure context to be @guaranteed. That will be implemented as the
next step.

Many SIL passes pattern match partial_apply sequences. These all
needed to be fixed to handle the convert_function that SILGen now
emits. The conversion is now needed whenever a function declaration,
which has an escaping type, is passed into a @NoEscape argument.

In addition to supporting new SIL patterns, some optimizations like
inlining and SIL combine are now stronger which could perturb some
benchmark results.

These underlying SIL changes should be merged now to avoid conflicting
with other work. Minor benchmark discrepancies can be investigated as part of
the stack-allocation work.

@atrick
Copy link
Contributor Author

atrick commented Oct 13, 2017

@swift-ci benchmark.

@atrick
Copy link
Contributor Author

atrick commented Oct 13, 2017

@swift-ci test.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 900c780cf41b467bd71421b744ef8d82d96baf14

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 900c780cf41b467bd71421b744ef8d82d96baf14

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (1)
TEST OLD NEW DELTA SPEEDUP
PopFrontUnsafePointer 5219 6090 +16.7% 0.86x (?)
Improvement (4)
TEST OLD NEW DELTA SPEEDUP
PrefixWhileArray 74 68 -8.1% 1.09x
RangeAssignment 372 343 -7.8% 1.08x
NSStringConversion 370 345 -6.8% 1.07x
MapReduce 392 369 -5.9% 1.06x (?)
No Changes (329)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2911 2899 -0.4% 1.00x (?)
AnyHashableWithAClass 66804 67126 +0.5% 1.00x (?)
Array2D 1938 1925 -0.7% 1.01x (?)
ArrayAppend 1076 1076 +0.0% 1.00x
ArrayAppendArrayOfInt 599 597 -0.3% 1.00x (?)
ArrayAppendAscii 20154 20103 -0.3% 1.00x (?)
ArrayAppendFromGeneric 598 599 +0.2% 1.00x (?)
ArrayAppendGenericStructs 1221 1222 +0.1% 1.00x (?)
ArrayAppendLatin1 40955 40960 +0.0% 1.00x (?)
ArrayAppendLazyMap 988 988 +0.0% 1.00x
ArrayAppendOptionals 1225 1234 +0.7% 0.99x (?)
ArrayAppendRepeatCol 997 998 +0.1% 1.00x (?)
ArrayAppendReserved 839 839 +0.0% 1.00x
ArrayAppendSequence 912 912 +0.0% 1.00x
ArrayAppendStrings 15003 15067 +0.4% 1.00x (?)
ArrayAppendToFromGeneric 599 599 +0.0% 1.00x
ArrayAppendToGeneric 599 598 -0.2% 1.00x (?)
ArrayAppendUTF16 40661 41678 +2.5% 0.98x
ArrayInClass 61 61 +0.0% 1.00x
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD 230 230 +0.0% 1.00x
ArrayOfGenericRef 3976 3964 -0.3% 1.00x (?)
ArrayOfPOD 176 176 +0.0% 1.00x
ArrayOfRef 3874 3880 +0.2% 1.00x (?)
ArrayPlusEqualArrayOfInt 599 598 -0.2% 1.00x (?)
ArrayPlusEqualFiveElementCollection 4755 4763 +0.2% 1.00x (?)
ArrayPlusEqualSingleElementCollection 1076 1075 -0.1% 1.00x (?)
ArrayPlusEqualThreeElements 1626 1624 -0.1% 1.00x (?)
ArraySetElement 424 424 +0.0% 1.00x
ArraySubscript 1491 1489 -0.1% 1.00x (?)
ArrayValueProp 6 6 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
ArrayValueProp4 6 6 +0.0% 1.00x
BitCount 144 144 +0.0% 1.00x
ByteSwap 113 113 +0.0% 1.00x
CStringLongAscii 4883 4803 -1.6% 1.02x (?)
CStringLongNonAscii 2196 2216 +0.9% 0.99x (?)
CStringShortAscii 4895 4845 -1.0% 1.01x (?)
Calculator 34 35 +2.9% 0.97x
CaptureProp 4249 4247 -0.0% 1.00x (?)
CharIndexing_ascii_unicodeScalars 13832 13828 -0.0% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 11062 11052 -0.1% 1.00x (?)
CharIndexing_chinese_unicodeScalars 10485 10488 +0.0% 1.00x (?)
CharIndexing_chinese_unicodeScalars_Backwards 8395 8391 -0.0% 1.00x (?)
CharIndexing_japanese_unicodeScalars 16550 16548 -0.0% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 13237 13225 -0.1% 1.00x (?)
CharIndexing_korean_unicodeScalars 13412 13412 +0.0% 1.00x
CharIndexing_korean_unicodeScalars_Backwards 10728 10726 -0.0% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 2549 2542 -0.3% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2052 2049 -0.1% 1.00x (?)
CharIndexing_punctuated_unicodeScalars 3170 3158 -0.4% 1.00x
CharIndexing_punctuated_unicodeScalars_Backwards 2570 2549 -0.8% 1.01x
CharIndexing_russian_unicodeScalars 11531 11526 -0.0% 1.00x (?)
CharIndexing_russian_unicodeScalars_Backwards 9238 9224 -0.2% 1.00x
CharIndexing_tweet_unicodeScalars 27322 27268 -0.2% 1.00x (?)
CharIndexing_tweet_unicodeScalars_Backwards 21805 21781 -0.1% 1.00x (?)
CharIndexing_utf16_unicodeScalars 81349 81303 -0.1% 1.00x (?)
CharIndexing_utf16_unicodeScalars_Backwards 60384 60450 +0.1% 1.00x (?)
CharIteration_ascii_unicodeScalars 15428 15619 +1.2% 0.99x (?)
CharIteration_ascii_unicodeScalars_Backwards 16384 16374 -0.1% 1.00x (?)
CharIteration_chinese_unicodeScalars 11674 11835 +1.4% 0.99x
CharIteration_chinese_unicodeScalars_Backwards 12407 12399 -0.1% 1.00x (?)
CharIteration_japanese_unicodeScalars 18454 18697 +1.3% 0.99x
CharIteration_japanese_unicodeScalars_Backwards 19614 19606 -0.0% 1.00x (?)
CharIteration_korean_unicodeScalars 14959 15146 +1.3% 0.99x
CharIteration_korean_unicodeScalars_Backwards 15882 15882 +0.0% 1.00x
CharIteration_punctuatedJapanese_unicodeScalars 2810 2840 +1.1% 0.99x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2962 2955 -0.2% 1.00x (?)
CharIteration_punctuated_unicodeScalars 3504 3547 +1.2% 0.99x
CharIteration_punctuated_unicodeScalars_Backwards 3707 3699 -0.2% 1.00x (?)
CharIteration_russian_unicodeScalars 12855 13016 +1.3% 0.99x (?)
CharIteration_russian_unicodeScalars_Backwards 13650 13640 -0.1% 1.00x (?)
CharIteration_tweet_unicodeScalars 30388 30780 +1.3% 0.99x (?)
CharIteration_tweet_unicodeScalars_Backwards 32371 32348 -0.1% 1.00x (?)
CharIteration_utf16_unicodeScalars 79686 78669 -1.3% 1.01x (?)
CharIteration_utf16_unicodeScalars_Backwards 97740 97570 -0.2% 1.00x
CharacterLiteralsLarge 6016 6009 -0.1% 1.00x (?)
CharacterLiteralsSmall 404 404 +0.0% 1.00x
Chars 417 417 +0.0% 1.00x
ClassArrayGetter 13 13 +0.0% 1.00x
DeadArray 184 184 +0.0% 1.00x
Dictionary 571 574 +0.5% 0.99x (?)
Dictionary2 1896 1902 +0.3% 1.00x (?)
Dictionary2OfObjects 3299 3308 +0.3% 1.00x (?)
Dictionary3 468 467 -0.2% 1.00x (?)
Dictionary3OfObjects 840 841 +0.1% 1.00x (?)
DictionaryBridge 2484 2486 +0.1% 1.00x (?)
DictionaryGroup 274 273 -0.4% 1.00x (?)
DictionaryGroupOfObjects 1800 1807 +0.4% 1.00x (?)
DictionaryLiteral 1480 1478 -0.1% 1.00x (?)
DictionaryOfObjects 2272 2270 -0.1% 1.00x (?)
DictionaryRemove 2508 2498 -0.4% 1.00x (?)
DictionaryRemoveOfObjects 23873 23958 +0.4% 1.00x (?)
DictionarySwap 414 415 +0.2% 1.00x (?)
DictionarySwapOfObjects 7478 7471 -0.1% 1.00x (?)
DropFirstAnyCollection 55 55 +0.0% 1.00x
DropFirstAnyCollectionLazy 74959 75393 +0.6% 0.99x (?)
DropFirstAnySeqCRangeIter 28063 28361 +1.1% 0.99x (?)
DropFirstAnySeqCRangeIterLazy 28060 28369 +1.1% 0.99x (?)
DropFirstAnySeqCntRange 50 50 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 51 50 -2.0% 1.02x
DropFirstAnySequence 6240 6225 -0.2% 1.00x (?)
DropFirstAnySequenceLazy 6261 6221 -0.6% 1.01x (?)
DropFirstArray 30 30 +0.0% 1.00x
DropFirstArrayLazy 30 30 +0.0% 1.00x
DropFirstCountableRange 18 18 +0.0% 1.00x
DropFirstCountableRangeLazy 18 18 +0.0% 1.00x
DropFirstSequence 2019 2019 +0.0% 1.00x
DropFirstSequenceLazy 1944 1944 +0.0% 1.00x
DropLastAnyCollection 21 21 +0.0% 1.00x
DropLastAnyCollectionLazy 25004 25141 +0.5% 0.99x (?)
DropLastAnySeqCRangeIter 4719 4718 -0.0% 1.00x (?)
DropLastAnySeqCRangeIterLazy 4718 4718 +0.0% 1.00x
DropLastAnySeqCntRange 16 16 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 16 16 +0.0% 1.00x
DropLastAnySequence 6726 6727 +0.0% 1.00x (?)
DropLastAnySequenceLazy 6675 6676 +0.0% 1.00x (?)
DropLastArray 10 10 +0.0% 1.00x
DropLastArrayLazy 10 10 +0.0% 1.00x
DropLastCountableRange 6 6 +0.0% 1.00x
DropLastCountableRangeLazy 6 6 +0.0% 1.00x
DropLastSequence 603 599 -0.7% 1.01x (?)
DropLastSequenceLazy 602 596 -1.0% 1.01x (?)
DropWhileAnyCollection 68 68 +0.0% 1.00x
DropWhileAnyCollectionLazy 89 89 +0.0% 1.00x
DropWhileAnySeqCRangeIter 22834 22805 -0.1% 1.00x (?)
DropWhileAnySeqCRangeIterLazy 90 90 +0.0% 1.00x
DropWhileAnySeqCntRange 63 63 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 90 90 +0.0% 1.00x
DropWhileAnySequence 7283 7268 -0.2% 1.00x (?)
DropWhileAnySequenceLazy 1933 1933 +0.0% 1.00x
DropWhileArray 43 43 +0.0% 1.00x
DropWhileArrayLazy 82 82 +0.0% 1.00x
DropWhileCountableRange 19 19 +0.0% 1.00x
DropWhileCountableRangeLazy 70 70 +0.0% 1.00x
DropWhileSequence 1616 1621 +0.3% 1.00x (?)
DropWhileSequenceLazy 47 47 +0.0% 1.00x
EqualStringSubstring 388 388 +0.0% 1.00x
EqualSubstringString 389 389 +0.0% 1.00x
EqualSubstringSubstring 390 389 -0.3% 1.00x
EqualSubstringSubstringGenericEquatable 392 391 -0.3% 1.00x (?)
ErrorHandling 2033 2040 +0.3% 1.00x (?)
ExclusivityGlobal 3 3 +0.0% 1.00x
ExclusivityInMatSet 18 18 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduce 1298 1287 -0.8% 1.01x (?)
FilterEvenUsingReduceInto 147 147 +0.0% 1.00x
FrequenciesUsingReduce 7467 7431 -0.5% 1.00x (?)
FrequenciesUsingReduceInto 4127 4112 -0.4% 1.00x (?)
Hanoi 3544 3538 -0.2% 1.00x (?)
HashTest 1630 1632 +0.1% 1.00x (?)
Histogram 278 278 +0.0% 1.00x
Integrate 249 249 +0.0% 1.00x
IterateData 1429 1421 -0.6% 1.01x (?)
Join 390 381 -2.3% 1.02x (?)
LazilyFilteredArrayContains 90732 90788 +0.1% 1.00x (?)
LazilyFilteredArrays 65738 65572 -0.3% 1.00x (?)
LazilyFilteredRange 3755 3755 +0.0% 1.00x
LessSubstringSubstring 389 389 +0.0% 1.00x
LessSubstringSubstringGenericComparable 388 389 +0.3% 1.00x (?)
LinkedList 6976 6973 -0.0% 1.00x (?)
MapReduceAnyCollection 363 362 -0.3% 1.00x (?)
MapReduceAnyCollectionShort 2128 2129 +0.0% 1.00x (?)
MapReduceClass 3064 3062 -0.1% 1.00x (?)
MapReduceClassShort 4527 4541 +0.3% 1.00x (?)
MapReduceLazyCollection 12 12 +0.0% 1.00x
MapReduceLazyCollectionShort 36 36 +0.0% 1.00x
MapReduceLazySequence 90 90 +0.0% 1.00x
MapReduceSequence 440 441 +0.2% 1.00x (?)
MapReduceShort 1968 1981 +0.7% 0.99x
MapReduceShortString 22 21 -4.5% 1.05x (?)
MapReduceString 99 97 -2.0% 1.02x
Memset 234 235 +0.4% 1.00x
MonteCarloE 10372 10360 -0.1% 1.00x (?)
MonteCarloPi 43976 43927 -0.1% 1.00x (?)
NSDictionaryCastToSwift 5288 5292 +0.1% 1.00x (?)
NSError 290 293 +1.0% 0.99x (?)
NopDeinit 22885 22881 -0.0% 1.00x (?)
ObjectAllocation 177 177 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 22470 22595 +0.6% 0.99x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 3456 3460 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 38950 39355 +1.0% 0.99x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 33417 33481 +0.2% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 119144 119669 +0.4% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5057 5107 +1.0% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 90742 91710 +1.1% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 100771 100722 -0.0% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObject 64338 64282 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4247 4237 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 67278 67198 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 68289 69682 +2.0% 0.98x (?)
ObjectiveCBridgeFromNSString 987 987 +0.0% 1.00x
ObjectiveCBridgeFromNSStringForced 1842 1865 +1.2% 0.99x (?)
ObjectiveCBridgeStubDataAppend 3827 3832 +0.1% 1.00x (?)
ObjectiveCBridgeStubDateAccess 181 181 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 272 272 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 24895 25096 +0.8% 0.99x (?)
ObjectiveCBridgeStubFromNSDate 3604 3685 +2.2% 0.98x (?)
ObjectiveCBridgeStubFromNSDateRef 4193 4277 +2.0% 0.98x
ObjectiveCBridgeStubFromNSString 547 528 -3.5% 1.04x (?)
ObjectiveCBridgeStubFromNSStringRef 146 146 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2426 2414 -0.5% 1.00x (?)
ObjectiveCBridgeStubNSDateMutationRef 12934 13218 +2.2% 0.98x (?)
ObjectiveCBridgeStubNSDateRefAccess 371 373 +0.5% 0.99x (?)
ObjectiveCBridgeStubToArrayOfNSString 28600 28999 +1.4% 0.99x (?)
ObjectiveCBridgeStubToNSDate 14551 14624 +0.5% 1.00x (?)
ObjectiveCBridgeStubToNSDateRef 3204 3262 +1.8% 0.98x (?)
ObjectiveCBridgeStubToNSString 1488 1483 -0.3% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 117 117 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 210478 209609 -0.4% 1.00x (?)
ObjectiveCBridgeStubURLAppendPathRef 208651 208704 +0.0% 1.00x (?)
ObjectiveCBridgeToNSArray 29259 29103 -0.5% 1.01x (?)
ObjectiveCBridgeToNSDictionary 45945 45460 -1.1% 1.01x (?)
ObjectiveCBridgeToNSSet 39361 39178 -0.5% 1.00x (?)
ObjectiveCBridgeToNSString 1271 1269 -0.2% 1.00x (?)
ObserverClosure 2311 2306 -0.2% 1.00x (?)
ObserverForwarderStruct 1143 1144 +0.1% 1.00x (?)
ObserverPartiallyAppliedMethod 3795 3780 -0.4% 1.00x (?)
ObserverUnappliedMethod 2662 2652 -0.4% 1.00x (?)
OpenClose 3 3 +0.0% 1.00x
Phonebook 6197 6250 +0.9% 0.99x
PolymorphicCalls 17 17 +0.0% 1.00x
PopFrontArray 1279 1274 -0.4% 1.00x (?)
PopFrontArrayGeneric 1277 1276 -0.1% 1.00x (?)
PrefixAnyCollection 55 55 +0.0% 1.00x
PrefixAnyCollectionLazy 75008 75265 +0.3% 1.00x (?)
PrefixAnySeqCRangeIter 22021 22172 +0.7% 0.99x (?)
PrefixAnySeqCRangeIterLazy 22024 22172 +0.7% 0.99x (?)
PrefixAnySeqCntRange 50 50 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 50 50 +0.0% 1.00x
PrefixAnySequence 5415 5437 +0.4% 1.00x (?)
PrefixAnySequenceLazy 5426 5462 +0.7% 0.99x (?)
PrefixArray 30 30 +0.0% 1.00x
PrefixArrayLazy 30 30 +0.0% 1.00x
PrefixCountableRange 18 18 +0.0% 1.00x
PrefixCountableRangeLazy 18 18 +0.0% 1.00x
PrefixSequence 1515 1515 +0.0% 1.00x
PrefixSequenceLazy 1459 1459 +0.0% 1.00x
PrefixWhileAnyCollection 93 93 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 66 66 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 12911 12899 -0.1% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 66 66 +0.0% 1.00x
PrefixWhileAnySeqCntRange 88 88 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 66 66 +0.0% 1.00x
PrefixWhileAnySequence 14336 14332 -0.0% 1.00x (?)
PrefixWhileAnySequenceLazy 1436 1436 +0.0% 1.00x
PrefixWhileArrayLazy 37 37 +0.0% 1.00x
PrefixWhileCountableRange 29 29 +0.0% 1.00x
PrefixWhileCountableRangeLazy 18 18 +0.0% 1.00x
PrefixWhileSequence 366 356 -2.7% 1.03x
PrefixWhileSequenceLazy 28 28 +0.0% 1.00x
Prims 773 759 -1.8% 1.02x
PrimsSplit 763 762 -0.1% 1.00x (?)
ProtocolDispatch 3030 3030 +0.0% 1.00x
ProtocolDispatch2 138 140 +1.4% 0.99x
RC4 157 157 +0.0% 1.00x
RGBHistogram 2183 2169 -0.6% 1.01x (?)
RGBHistogramOfObjects 23392 23342 -0.2% 1.00x (?)
RangeIterationSigned 135 134 -0.7% 1.01x (?)
RangeIterationSigned64 151 151 +0.0% 1.00x
RangeIterationUnsigned 152 151 -0.7% 1.01x (?)
RecursiveOwnedParameter 2318 2299 -0.8% 1.01x
ReversedArray 44 45 +2.3% 0.98x (?)
ReversedBidirectional 29191 29121 -0.2% 1.00x (?)
ReversedDictionary 105 109 +3.8% 0.96x (?)
SetExclusiveOr 2747 2802 +2.0% 0.98x (?)
SetExclusiveOr_OfObjects 8243 8473 +2.8% 0.97x (?)
SetIntersect 270 270 +0.0% 1.00x
SetIntersect_OfObjects 1714 1717 +0.2% 1.00x (?)
SetIsSubsetOf 293 293 +0.0% 1.00x
SetIsSubsetOf_OfObjects 366 366 +0.0% 1.00x
SetUnion 2457 2538 +3.3% 0.97x (?)
SetUnion_OfObjects 6848 6983 +2.0% 0.98x (?)
SevenBoom 1493 1495 +0.1% 1.00x (?)
Sim2DArray 450 450 +0.0% 1.00x
SortLargeExistentials 8357 8317 -0.5% 1.00x
SortLettersInPlace 1139 1138 -0.1% 1.00x (?)
SortSortedStrings 906 912 +0.7% 0.99x
SortStrings 1698 1704 +0.4% 1.00x (?)
SortStringsUnicode 8288 8264 -0.3% 1.00x (?)
StackPromo 22645 22696 +0.2% 1.00x (?)
StaticArray 6 6 +0.0% 1.00x
StrComplexWalk 1587 1595 +0.5% 0.99x (?)
StrToInt 1876 1808 -3.6% 1.04x
StringAdder 3542 3546 +0.1% 1.00x (?)
StringBuilder 1008 1008 +0.0% 1.00x
StringBuilderLong 935 932 -0.3% 1.00x (?)
StringEdits 169493 169496 +0.0% 1.00x (?)
StringEnumRawValueInitialization 803 781 -2.7% 1.03x
StringEqualPointerComparison 363 363 +0.0% 1.00x
StringFromLongWholeSubstring 177 180 +1.7% 0.98x
StringFromLongWholeSubstringGeneric 86 86 +0.0% 1.00x
StringHasPrefix 9 9 +0.0% 1.00x
StringHasPrefixUnicode 14962 14895 -0.4% 1.00x (?)
StringHasSuffix 9 9 +0.0% 1.00x
StringHasSuffixUnicode 61242 61324 +0.1% 1.00x (?)
StringInterpolation 10917 10887 -0.3% 1.00x (?)
StringMatch 7399 7197 -2.7% 1.03x (?)
StringUTF16Builder 1868 1882 +0.7% 0.99x (?)
StringWalk 1491 1478 -0.9% 1.01x
StringWithCString 66257 66286 +0.0% 1.00x (?)
SubstringComparable 1616 1634 +1.1% 0.99x
SubstringEqualString 1436 1456 +1.4% 0.99x (?)
SubstringEquatable 3703 3710 +0.2% 1.00x (?)
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 62 62 +0.0% 1.00x
SuffixAnyCollection 21 21 +0.0% 1.00x
SuffixAnyCollectionLazy 24911 25133 +0.9% 0.99x (?)
SuffixAnySeqCRangeIter 5043 5044 +0.0% 1.00x (?)
SuffixAnySeqCRangeIterLazy 5046 5044 -0.0% 1.00x (?)
SuffixAnySeqCntRange 16 16 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 16 16 +0.0% 1.00x
SuffixAnySequence 6710 6709 -0.0% 1.00x (?)
SuffixAnySequenceLazy 6705 6710 +0.1% 1.00x (?)
SuffixArray 10 10 +0.0% 1.00x
SuffixArrayLazy 10 10 +0.0% 1.00x
SuffixCountableRange 6 6 +0.0% 1.00x
SuffixCountableRangeLazy 6 6 +0.0% 1.00x
SuffixSequence 4674 4674 +0.0% 1.00x
SuffixSequenceLazy 4670 4667 -0.1% 1.00x (?)
SumUsingReduce 97 96 -1.0% 1.01x
SumUsingReduceInto 97 97 +0.0% 1.00x
SuperChars 84965 84771 -0.2% 1.00x (?)
TwoSum 944 955 +1.2% 0.99x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 257 257 +0.0% 1.00x
Walsh 400 399 -0.2% 1.00x (?)
XorLoop 347 347 +0.0% 1.00x

Unoptimized (Onone)

Regression (2)
TEST OLD NEW DELTA SPEEDUP
ArrayInClass 6426 6830 +6.3% 0.94x
ObjectiveCBridgeStubDateMutation 486 515 +6.0% 0.94x
Improvement (12)
TEST OLD NEW DELTA SPEEDUP
ProtocolDispatch 8524 7551 -11.4% 1.13x
NSStringConversion 410 379 -7.6% 1.08x
Calculator 1165 1094 -6.1% 1.06x
CharIndexing_ascii_unicodeScalars_Backwards 540306 509103 -5.8% 1.06x
CharIndexing_chinese_unicodeScalars_Backwards 407508 384786 -5.6% 1.06x
CharIndexing_korean_unicodeScalars_Backwards 522454 493514 -5.5% 1.06x
ObjectiveCBridgeStubDateAccess 1091 1031 -5.5% 1.06x
ArrayAppend 4361 4126 -5.4% 1.06x
CharIndexing_punctuated_unicodeScalars_Backwards 117904 111606 -5.3% 1.06x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 93328 88374 -5.3% 1.06x
ObjectiveCBridgeStubFromNSString 591 560 -5.2% 1.06x
CharIndexing_russian_unicodeScalars_Backwards 448803 426610 -4.9% 1.05x
No Changes (320)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 4932 5011 +1.6% 0.98x (?)
AnyHashableWithAClass 84360 84736 +0.4% 1.00x (?)
Array2D 636201 636736 +0.1% 1.00x (?)
ArrayAppendArrayOfInt 657 656 -0.2% 1.00x
ArrayAppendAscii 53158 53564 +0.8% 0.99x
ArrayAppendFromGeneric 661 657 -0.6% 1.01x (?)
ArrayAppendGenericStructs 1295 1294 -0.1% 1.00x (?)
ArrayAppendLatin1 82211 81481 -0.9% 1.01x
ArrayAppendLazyMap 228520 230940 +1.1% 0.99x
ArrayAppendOptionals 1344 1285 -4.4% 1.05x
ArrayAppendRepeatCol 232417 228798 -1.6% 1.02x
ArrayAppendReserved 4051 3912 -3.4% 1.04x
ArrayAppendSequence 76028 76794 +1.0% 0.99x
ArrayAppendStrings 15206 15237 +0.2% 1.00x (?)
ArrayAppendToFromGeneric 659 659 +0.0% 1.00x
ArrayAppendToGeneric 660 659 -0.2% 1.00x (?)
ArrayAppendUTF16 76447 77164 +0.9% 0.99x (?)
ArrayLiteral 1764 1754 -0.6% 1.01x (?)
ArrayOfGenericPOD 1206 1203 -0.2% 1.00x (?)
ArrayOfGenericRef 10010 9983 -0.3% 1.00x (?)
ArrayOfPOD 713 713 +0.0% 1.00x
ArrayOfRef 9221 9261 +0.4% 1.00x (?)
ArrayPlusEqualArrayOfInt 657 658 +0.2% 1.00x (?)
ArrayPlusEqualFiveElementCollection 310574 309118 -0.5% 1.00x (?)
ArrayPlusEqualSingleElementCollection 306025 305174 -0.3% 1.00x (?)
ArrayPlusEqualThreeElements 10997 11223 +2.1% 0.98x
ArraySetElement 4582 4581 -0.0% 1.00x (?)
ArraySubscript 84051 85282 +1.5% 0.99x
ArrayValueProp 3568 3564 -0.1% 1.00x (?)
ArrayValueProp2 18896 18887 -0.0% 1.00x (?)
ArrayValueProp3 4110 4072 -0.9% 1.01x (?)
ArrayValueProp4 4087 4080 -0.2% 1.00x (?)
BitCount 1604 1579 -1.6% 1.02x
ByteSwap 4150 4040 -2.7% 1.03x
CStringLongAscii 4928 4753 -3.6% 1.04x
CStringLongNonAscii 2452 2389 -2.6% 1.03x
CStringShortAscii 8742 8755 +0.1% 1.00x (?)
CaptureProp 125641 124940 -0.6% 1.01x (?)
CharIndexing_ascii_unicodeScalars 497688 483617 -2.8% 1.03x
CharIndexing_chinese_unicodeScalars 376145 366416 -2.6% 1.03x (?)
CharIndexing_japanese_unicodeScalars 594906 577315 -3.0% 1.03x
CharIndexing_japanese_unicodeScalars_Backwards 649479 620257 -4.5% 1.05x
CharIndexing_korean_unicodeScalars 480591 465829 -3.1% 1.03x
CharIndexing_punctuatedJapanese_unicodeScalars 85215 82942 -2.7% 1.03x
CharIndexing_punctuated_unicodeScalars 108628 106016 -2.4% 1.02x
CharIndexing_russian_unicodeScalars 412920 398975 -3.4% 1.03x
CharIndexing_tweet_unicodeScalars 982366 953690 -2.9% 1.03x (?)
CharIndexing_tweet_unicodeScalars_Backwards 1066851 1018597 -4.5% 1.05x
CharIndexing_utf16_unicodeScalars 537629 533352 -0.8% 1.01x (?)
CharIndexing_utf16_unicodeScalars_Backwards 580984 571750 -1.6% 1.02x
CharIteration_ascii_unicodeScalars 185471 184073 -0.8% 1.01x (?)
CharIteration_ascii_unicodeScalars_Backwards 329508 321431 -2.5% 1.03x (?)
CharIteration_chinese_unicodeScalars 139911 139450 -0.3% 1.00x (?)
CharIteration_chinese_unicodeScalars_Backwards 247070 243657 -1.4% 1.01x
CharIteration_japanese_unicodeScalars 221382 221145 -0.1% 1.00x (?)
CharIteration_japanese_unicodeScalars_Backwards 390952 385836 -1.3% 1.01x (?)
CharIteration_korean_unicodeScalars 179063 178305 -0.4% 1.00x
CharIteration_korean_unicodeScalars_Backwards 318997 312764 -2.0% 1.02x
CharIteration_punctuatedJapanese_unicodeScalars 32837 32685 -0.5% 1.00x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 57062 55688 -2.4% 1.02x (?)
CharIteration_punctuated_unicodeScalars 41432 41043 -0.9% 1.01x
CharIteration_punctuated_unicodeScalars_Backwards 72190 70808 -1.9% 1.02x
CharIteration_russian_unicodeScalars 154110 152986 -0.7% 1.01x
CharIteration_russian_unicodeScalars_Backwards 272612 267325 -1.9% 1.02x
CharIteration_tweet_unicodeScalars 374068 370641 -0.9% 1.01x
CharIteration_tweet_unicodeScalars_Backwards 653578 640920 -1.9% 1.02x
CharIteration_utf16_unicodeScalars 205914 203782 -1.0% 1.01x (?)
CharIteration_utf16_unicodeScalars_Backwards 400917 398186 -0.7% 1.01x (?)
CharacterLiteralsLarge 6306 6310 +0.1% 1.00x (?)
CharacterLiteralsSmall 703 715 +1.7% 0.98x
Chars 50605 50587 -0.0% 1.00x (?)
ClassArrayGetter 991 1014 +2.3% 0.98x
DeadArray 114162 115075 +0.8% 0.99x (?)
Dictionary 3115 3107 -0.3% 1.00x (?)
Dictionary2 3476 3470 -0.2% 1.00x (?)
Dictionary2OfObjects 6044 6049 +0.1% 1.00x (?)
Dictionary3 1353 1344 -0.7% 1.01x (?)
Dictionary3OfObjects 2301 2306 +0.2% 1.00x (?)
DictionaryBridge 2579 2647 +2.6% 0.97x (?)
DictionaryGroup 5415 5388 -0.5% 1.01x (?)
DictionaryGroupOfObjects 8258 8219 -0.5% 1.00x (?)
DictionaryLiteral 8619 8581 -0.4% 1.00x (?)
DictionaryOfObjects 6748 6719 -0.4% 1.00x (?)
DictionaryRemove 22122 21854 -1.2% 1.01x
DictionaryRemoveOfObjects 58978 59106 +0.2% 1.00x (?)
DictionarySwap 5325 5446 +2.3% 0.98x
DictionarySwapOfObjects 23058 23194 +0.6% 0.99x (?)
DropFirstAnyCollection 20351 20489 +0.7% 0.99x (?)
DropFirstAnyCollectionLazy 142475 142641 +0.1% 1.00x (?)
DropFirstAnySeqCRangeIter 30962 31299 +1.1% 0.99x (?)
DropFirstAnySeqCRangeIterLazy 30600 30832 +0.8% 0.99x (?)
DropFirstAnySeqCntRange 20678 20729 +0.2% 1.00x (?)
DropFirstAnySeqCntRangeLazy 20412 20498 +0.4% 1.00x
DropFirstAnySequence 15747 15710 -0.2% 1.00x (?)
DropFirstAnySequenceLazy 15787 15711 -0.5% 1.00x (?)
DropFirstArray 6389 6425 +0.6% 0.99x
DropFirstArrayLazy 44689 44870 +0.4% 1.00x
DropFirstCountableRange 340 341 +0.3% 1.00x (?)
DropFirstCountableRangeLazy 40953 41141 +0.5% 1.00x
DropFirstSequence 14722 14623 -0.7% 1.01x
DropFirstSequenceLazy 14629 14613 -0.1% 1.00x (?)
DropLastAnyCollection 6800 6850 +0.7% 0.99x (?)
DropLastAnyCollectionLazy 46971 47496 +1.1% 0.99x (?)
DropLastAnySeqCRangeIter 47370 47353 -0.0% 1.00x (?)
DropLastAnySeqCRangeIterLazy 47549 47540 -0.0% 1.00x (?)
DropLastAnySeqCntRange 6797 6834 +0.5% 0.99x (?)
DropLastAnySeqCntRangeLazy 6861 6899 +0.6% 0.99x
DropLastAnySequence 33676 33576 -0.3% 1.00x
DropLastAnySequenceLazy 33610 33624 +0.0% 1.00x (?)
DropLastArray 2136 2133 -0.1% 1.00x
DropLastArrayLazy 14890 14971 +0.5% 0.99x (?)
DropLastCountableRange 119 119 +0.0% 1.00x
DropLastCountableRangeLazy 13699 13794 +0.7% 0.99x (?)
DropLastSequence 33263 33195 -0.2% 1.00x (?)
DropLastSequenceLazy 33290 33250 -0.1% 1.00x (?)
DropWhileAnyCollection 26452 26601 +0.6% 0.99x (?)
DropWhileAnyCollectionLazy 28715 29066 +1.2% 0.99x (?)
DropWhileAnySeqCRangeIter 33040 33157 +0.4% 1.00x
DropWhileAnySeqCRangeIterLazy 28866 29097 +0.8% 0.99x
DropWhileAnySeqCntRange 26768 27000 +0.9% 0.99x
DropWhileAnySeqCntRangeLazy 28737 29352 +2.1% 0.98x
DropWhileAnySequence 18718 18703 -0.1% 1.00x (?)
DropWhileAnySequenceLazy 15046 15019 -0.2% 1.00x
DropWhileArray 10022 10053 +0.3% 1.00x
DropWhileArrayLazy 17420 17512 +0.5% 0.99x
DropWhileCountableRange 6425 6496 +1.1% 0.99x
DropWhileCountableRangeLazy 28107 28186 +0.3% 1.00x (?)
DropWhileSequence 17642 17589 -0.3% 1.00x
DropWhileSequenceLazy 13698 13696 -0.0% 1.00x (?)
EqualStringSubstring 676 676 +0.0% 1.00x
EqualSubstringString 674 674 +0.0% 1.00x
EqualSubstringSubstring 790 793 +0.4% 1.00x
EqualSubstringSubstringGenericEquatable 425 422 -0.7% 1.01x
ErrorHandling 6822 6844 +0.3% 1.00x (?)
ExclusivityGlobal 172 178 +3.5% 0.97x
ExclusivityInMatSet 303 306 +1.0% 0.99x
ExclusivityIndependent 126 127 +0.8% 0.99x
FilterEvenUsingReduce 4296 4302 +0.1% 1.00x (?)
FilterEvenUsingReduceInto 2502 2535 +1.3% 0.99x
FrequenciesUsingReduce 15780 15801 +0.1% 1.00x (?)
FrequenciesUsingReduceInto 8835 8933 +1.1% 0.99x (?)
Hanoi 19195 19062 -0.7% 1.01x (?)
HashTest 17157 17289 +0.8% 0.99x
Histogram 8918 9001 +0.9% 0.99x (?)
Integrate 686 677 -1.3% 1.01x
IterateData 13437 13406 -0.2% 1.00x (?)
Join 1509 1503 -0.4% 1.00x (?)
LazilyFilteredArrayContains 5008867 4964925 -0.9% 1.01x
LazilyFilteredArrays 1737379 1743568 +0.4% 1.00x (?)
LazilyFilteredRange 726488 738284 +1.6% 0.98x
LessSubstringSubstring 791 789 -0.3% 1.00x (?)
LessSubstringSubstringGenericComparable 446 443 -0.7% 1.01x
LinkedList 40383 40259 -0.3% 1.00x
MapReduce 38620 38573 -0.1% 1.00x (?)
MapReduceAnyCollection 38664 38754 +0.2% 1.00x
MapReduceAnyCollectionShort 51605 51300 -0.6% 1.01x
MapReduceClass 44116 43374 -1.7% 1.02x
MapReduceClassShort 55603 54992 -1.1% 1.01x
MapReduceLazyCollection 36111 34648 -4.1% 1.04x
MapReduceLazyCollectionShort 46384 45677 -1.5% 1.02x
MapReduceLazySequence 30023 29751 -0.9% 1.01x
MapReduceSequence 45411 45226 -0.4% 1.00x
MapReduceShort 51122 50949 -0.3% 1.00x (?)
MapReduceShortString 279 280 +0.4% 1.00x (?)
MapReduceString 2658 2660 +0.1% 1.00x (?)
Memset 45159 45167 +0.0% 1.00x (?)
MonteCarloE 938269 954613 +1.7% 0.98x
MonteCarloPi 4019717 4054515 +0.9% 0.99x
NSDictionaryCastToSwift 6453 6486 +0.5% 0.99x (?)
NSError 731 728 -0.4% 1.00x (?)
NopDeinit 169959 169812 -0.1% 1.00x (?)
ObjectAllocation 1464 1465 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObject 25206 24933 -1.1% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6836 6821 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 41019 41077 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 34872 35232 +1.0% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 122564 122970 +0.3% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7550 7843 +3.9% 0.96x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 99841 99431 -0.4% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 103578 103358 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObject 69349 68674 -1.0% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7623 7573 -0.7% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 73951 73456 -0.7% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 73189 74569 +1.9% 0.98x (?)
ObjectiveCBridgeFromNSString 3973 4006 +0.8% 0.99x (?)
ObjectiveCBridgeFromNSStringForced 2235 2222 -0.6% 1.01x (?)
ObjectiveCBridgeStubDataAppend 4425 4358 -1.5% 1.02x (?)
ObjectiveCBridgeStubFromArrayOfNSString 25162 25694 +2.1% 0.98x (?)
ObjectiveCBridgeStubFromNSDate 3900 3827 -1.9% 1.02x
ObjectiveCBridgeStubFromNSDateRef 4461 4354 -2.4% 1.02x
ObjectiveCBridgeStubFromNSStringRef 176 184 +4.5% 0.96x
ObjectiveCBridgeStubNSDataAppend 2774 2764 -0.4% 1.00x (?)
ObjectiveCBridgeStubNSDateMutationRef 16125 16398 +1.7% 0.98x (?)
ObjectiveCBridgeStubNSDateRefAccess 1214 1227 +1.1% 0.99x (?)
ObjectiveCBridgeStubToArrayOfNSString 29572 29602 +0.1% 1.00x (?)
ObjectiveCBridgeStubToNSDate 14797 15570 +5.2% 0.95x (?)
ObjectiveCBridgeStubToNSDateRef 3352 3342 -0.3% 1.00x (?)
ObjectiveCBridgeStubToNSString 1551 1551 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 148 148 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 218018 217538 -0.2% 1.00x (?)
ObjectiveCBridgeStubURLAppendPathRef 216060 215453 -0.3% 1.00x (?)
ObjectiveCBridgeToNSArray 29527 29632 +0.4% 1.00x (?)
ObjectiveCBridgeToNSDictionary 46994 47188 +0.4% 1.00x (?)
ObjectiveCBridgeToNSSet 40739 40023 -1.8% 1.02x (?)
ObjectiveCBridgeToNSString 1312 1306 -0.5% 1.00x (?)
ObserverClosure 6958 6923 -0.5% 1.01x (?)
ObserverForwarderStruct 5124 5126 +0.0% 1.00x (?)
ObserverPartiallyAppliedMethod 8460 8457 -0.0% 1.00x (?)
ObserverUnappliedMethod 8991 8956 -0.4% 1.00x (?)
OpenClose 393 394 +0.3% 1.00x
Phonebook 21616 21031 -2.7% 1.03x
PolymorphicCalls 5137 5153 +0.3% 1.00x (?)
PopFrontArray 10275 10199 -0.7% 1.01x
PopFrontArrayGeneric 9227 9271 +0.5% 1.00x (?)
PopFrontUnsafePointer 7716 7708 -0.1% 1.00x (?)
PrefixAnyCollection 20355 20506 +0.7% 0.99x (?)
PrefixAnyCollectionLazy 140544 141730 +0.8% 0.99x (?)
PrefixAnySeqCRangeIter 24641 24961 +1.3% 0.99x
PrefixAnySeqCRangeIterLazy 24333 24638 +1.3% 0.99x
PrefixAnySeqCntRange 20727 20748 +0.1% 1.00x (?)
PrefixAnySeqCntRangeLazy 20483 20458 -0.1% 1.00x
PrefixAnySequence 12857 12940 +0.6% 0.99x (?)
PrefixAnySequenceLazy 12874 12935 +0.5% 1.00x (?)
PrefixArray 6377 6408 +0.5% 1.00x
PrefixArrayLazy 44701 44876 +0.4% 1.00x (?)
PrefixCountableRange 340 340 +0.0% 1.00x
PrefixCountableRangeLazy 40905 41180 +0.7% 0.99x (?)
PrefixSequence 11793 11758 -0.3% 1.00x
PrefixSequenceLazy 11898 11821 -0.6% 1.01x
PrefixWhileAnyCollection 38991 38826 -0.4% 1.00x (?)
PrefixWhileAnyCollectionLazy 23558 23735 +0.8% 0.99x (?)
PrefixWhileAnySeqCRangeIter 43589 42944 -1.5% 1.02x (?)
PrefixWhileAnySeqCRangeIterLazy 23545 23865 +1.4% 0.99x
PrefixWhileAnySeqCntRange 39269 39208 -0.2% 1.00x (?)
PrefixWhileAnySeqCntRangeLazy 23676 24096 +1.8% 0.98x (?)
PrefixWhileAnySequence 32856 32615 -0.7% 1.01x (?)
PrefixWhileAnySequenceLazy 13357 13343 -0.1% 1.00x
PrefixWhileArray 17378 17356 -0.1% 1.00x
PrefixWhileArrayLazy 15257 15253 -0.0% 1.00x (?)
PrefixWhileCountableRange 18878 18655 -1.2% 1.01x
PrefixWhileCountableRangeLazy 23269 23001 -1.2% 1.01x
PrefixWhileSequence 31663 31610 -0.2% 1.00x (?)
PrefixWhileSequenceLazy 12409 12403 -0.0% 1.00x (?)
Prims 10589 10539 -0.5% 1.00x (?)
PrimsSplit 10548 10550 +0.0% 1.00x (?)
ProtocolDispatch2 499 500 +0.2% 1.00x (?)
RC4 18748 18788 +0.2% 1.00x (?)
RGBHistogram 34499 34670 +0.5% 1.00x (?)
RGBHistogramOfObjects 106442 106259 -0.2% 1.00x (?)
RangeAssignment 5702 5649 -0.9% 1.01x
RangeIterationSigned 17510 17859 +2.0% 0.98x (?)
RangeIterationSigned64 51853 51876 +0.0% 1.00x (?)
RangeIterationUnsigned 47357 47441 +0.2% 1.00x (?)
RecursiveOwnedParameter 11019 11069 +0.5% 1.00x
ReversedArray 43857 44137 +0.6% 0.99x (?)
ReversedBidirectional 75474 75273 -0.3% 1.00x (?)
ReversedDictionary 29457 29566 +0.4% 1.00x (?)
SetExclusiveOr 23042 23045 +0.0% 1.00x (?)
SetExclusiveOr_OfObjects 48317 48255 -0.1% 1.00x (?)
SetIntersect 12608 12576 -0.3% 1.00x (?)
SetIntersect_OfObjects 12628 12638 +0.1% 1.00x (?)
SetIsSubsetOf 1897 1868 -1.5% 1.02x
SetIsSubsetOf_OfObjects 1564 1577 +0.8% 0.99x
SetUnion 12001 11904 -0.8% 1.01x
SetUnion_OfObjects 33730 33665 -0.2% 1.00x (?)
SevenBoom 1654 1632 -1.3% 1.01x (?)
Sim2DArray 44105 44104 -0.0% 1.00x (?)
SortLargeExistentials 17439 17339 -0.6% 1.01x (?)
SortLettersInPlace 3049 3068 +0.6% 0.99x
SortSortedStrings 1452 1460 +0.6% 0.99x
SortStrings 2634 2663 +1.1% 0.99x
SortStringsUnicode 9391 9381 -0.1% 1.00x (?)
StackPromo 104355 104953 +0.6% 0.99x (?)
StaticArray 4566 4589 +0.5% 0.99x
StrComplexWalk 6968 6987 +0.3% 1.00x (?)
StrToInt 126290 126244 -0.0% 1.00x (?)
StringAdder 3828 3820 -0.2% 1.00x
StringBuilder 7167 7167 +0.0% 1.00x
StringBuilderLong 1151 1118 -2.9% 1.03x (?)
StringEdits 378275 378980 +0.2% 1.00x (?)
StringEnumRawValueInitialization 12557 12709 +1.2% 0.99x (?)
StringEqualPointerComparison 2501 2504 +0.1% 1.00x (?)
StringFromLongWholeSubstring 212 214 +0.9% 0.99x
StringFromLongWholeSubstringGeneric 214 212 -0.9% 1.01x (?)
StringHasPrefix 1756 1758 +0.1% 1.00x (?)
StringHasPrefixUnicode 16618 16534 -0.5% 1.01x (?)
StringHasSuffix 1906 1899 -0.4% 1.00x
StringHasSuffixUnicode 63060 63231 +0.3% 1.00x
StringInterpolation 13748 13765 +0.1% 1.00x (?)
StringMatch 34696 34691 -0.0% 1.00x (?)
StringUTF16Builder 7942 7950 +0.1% 1.00x (?)
StringWalk 11818 12372 +4.7% 0.96x
StringWithCString 58960 57599 -2.3% 1.02x (?)
SubstringComparable 4331 4356 +0.6% 0.99x (?)
SubstringEqualString 6561 6509 -0.8% 1.01x (?)
SubstringEquatable 8438 8419 -0.2% 1.00x (?)
SubstringFromLongString 17 17 +0.0% 1.00x
SubstringFromLongStringGeneric 116 116 +0.0% 1.00x
SuffixAnyCollection 6809 6849 +0.6% 0.99x
SuffixAnyCollectionLazy 47008 47501 +1.0% 0.99x (?)
SuffixAnySeqCRangeIter 44825 44583 -0.5% 1.01x (?)
SuffixAnySeqCRangeIterLazy 45128 45009 -0.3% 1.00x (?)
SuffixAnySeqCntRange 6790 6839 +0.7% 0.99x (?)
SuffixAnySeqCntRangeLazy 6859 6867 +0.1% 1.00x (?)
SuffixAnySequence 31188 31099 -0.3% 1.00x (?)
SuffixAnySequenceLazy 31167 31221 +0.2% 1.00x (?)
SuffixArray 2138 2124 -0.7% 1.01x
SuffixArrayLazy 14888 14974 +0.6% 0.99x (?)
SuffixCountableRange 119 119 +0.0% 1.00x
SuffixCountableRangeLazy 13656 13794 +1.0% 0.99x (?)
SuffixSequence 30791 30763 -0.1% 1.00x (?)
SuffixSequenceLazy 30867 30785 -0.3% 1.00x
SumUsingReduce 230076 230864 +0.3% 1.00x (?)
SumUsingReduceInto 226223 226440 +0.1% 1.00x (?)
SuperChars 193592 192691 -0.5% 1.00x (?)
TwoSum 4408 4350 -1.3% 1.01x
TypeFlood 165 164 -0.6% 1.01x (?)
UTF8Decode 38227 38505 +0.7% 0.99x
Walsh 12147 12171 +0.2% 1.00x (?)
XorLoop 23578 23557 -0.1% 1.00x
Hardware Overview
  Model Name: Mac mini
  Model Identifier: Macmini7,1
  Processor Name: Intel Core i5
  Processor Speed: 2.8 GHz
  Number of Processors: 1
  Total Number of Cores: 2
  L2 Cache (per Core): 256 KB
  L3 Cache: 3 MB
  Memory: 16 GB

@slavapestov
Copy link
Contributor

Hi @atrick and @rjmccall, this looks promising!

About +0 closure contexts, @jckarter already started working on that a while back but didn't finish it -- take a look at the code guarded by the EnableGuaranteedClosureContexts flag.

Also, it would be nice if as part of doing this we could complete Joe's refactoring to change partial_apply to only apply a single context parameter, forming the partial apply forwarding thunk and closure context from a SILBoxType in SILGen.

@atrick
Copy link
Contributor Author

atrick commented Oct 13, 2017

@slavapestov I'm just getting this branch in working order so @aschwaighofer can start working on the guaranteed context change (see EnableGuaranteedClosureContexts), and the stack allocation optimization. (https://bugs.swift.org/browse/SR-5441).

I would also love to have the SILBoxType representation, along with a coulple other (non-ABI) changes to the closure representation like ditching @inout_aliasable. I created a new bug for this:
https://bugs.swift.org/browse/SR-6148

@rjmccall
Copy link
Contributor

Yeah, I think that the partial_apply improvements would be great but are not in any way blocking the use of non-escaping functions and callee_guaranteed contexts.

@atrick
Copy link
Contributor Author

atrick commented Oct 13, 2017

@swift-ci test.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 900c780cf41b467bd71421b744ef8d82d96baf14

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 900c780cf41b467bd71421b744ef8d82d96baf14

@slavapestov
Copy link
Contributor

When you convert_function to turn an escaping closure into a non-escaping one, will we actually emit a thunk in IRGen or are they ABI compatible?

Agreed that partial_apply rework is not blocking this in any way and doesn't impact ABI, it would just be nice to do if it wasn't too much work.

@atrick
Copy link
Contributor Author

atrick commented Oct 13, 2017

@swift-ci test.

@atrick
Copy link
Contributor Author

atrick commented Oct 13, 2017

@slavapestov convert_function is ABI-compatible by definition. I don't think anything in the PR can affect the ABI. When @aschwaighofer changes context ownership to guaranteed, then we can declare that the ABI context is an opaque word. Then the defining module can choose on its own to represent context as a stack address or ref-counted thing without affecting ABI.

@rjmccall
Copy link
Contributor

We would then need a different instruction in order to implement withoutActuallyEscaping (maybe just a partial_apply?), but I think that's reasonable.

@atrick
Copy link
Contributor Author

atrick commented Oct 14, 2017

@swift-ci smoke test.

@atrick
Copy link
Contributor Author

atrick commented Oct 14, 2017

@aschwaighofer, I've self-reviewed this PR and it passed testing and benchmarking. It should be ready for you to get started. I'll likely wait until Monday to merge so people have a little more time to review.

@slavapestov
Copy link
Contributor

The current implementation of withoutActuallyEscaping is not safe anyway, right? As in we don't trap if the function escapes. I think wrapping it in an additional closure is reasonable, since then we can emit a cleanup that checks the reference count of the wrapped context when we exit the scope, trapping if its not 1.

@atrick
Copy link
Contributor Author

atrick commented Oct 16, 2017

@slavapestov yep, that's the idea for withoutActuallyEscaping. It'll be checked once the optimizer relies on it.

atrick and others added 11 commits October 17, 2017 00:25
And set this attribute correctly when lowering formal function types to SILFunctionTypes based on @escaping.

This will allow stack allocation of closures, and unblock a related ABI change.
It might be better to use a specialized instruction here, but I'll leave that up to Andy.

Andy: And I'll leave that to Arnold who is implementing SIL support for guaranteed ownership of thick function types.
@atrick
Copy link
Contributor Author

atrick commented Oct 17, 2017

@swift-ci test.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 488e5aaa3284008280378dc7fa41f32fb9e617bb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 488e5aaa3284008280378dc7fa41f32fb9e617bb

@atrick
Copy link
Contributor Author

atrick commented Oct 17, 2017

@swift-ci test.

@atrick atrick merged commit d369aa4 into swiftlang:master Oct 17, 2017
@gparker42
Copy link
Contributor

I think this is causing a use-after-free in ASAN.
https://ci.swift.org/job/oss-swift-incremental-ASAN-RA-osx/443

@shahmishal
Copy link
Member

@atrick Also, we are seeing failure in source compatibility suite https://ci.swift.org/job/swift-master-source-compat-suite/510

gparker42 pushed a commit to gparker42/swift that referenced this pull request Oct 18, 2017
This reverts commit d369aa4.
It is failing in ASAN tests.
atrick added a commit that referenced this pull request Oct 19, 2017
Bug introduced in @NoEscape lowering: #12420

Fixes <rdar://problem/35055251> FAILED: ASAN use-after-free in MandatoryInlining.
@atrick atrick mentioned this pull request Oct 24, 2017
atrick added a commit that referenced this pull request Oct 25, 2017
Bug introduced in @NoEscape lowering: #12420

Fixes <rdar://problem/35055251> FAILED: ASAN use-after-free in MandatoryInlining.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants