Skip to content

AliasAnalysis: improve the may-decrement-ref-count check for builtins. #4573

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 1 commit into from
Aug 31, 2016

Conversation

eeckstein
Copy link
Contributor

This helps the ARC optimizations to eliminate retain-release pairs across the "destroyArray" builtin.

This helps the ARC optimizations to eliminate retain-release pairs across the "destroyArray" builtin.
@eeckstein
Copy link
Contributor Author

@swift-ci Please smoke test

@eeckstein
Copy link
Contributor Author

@swift-ci Please benchmark

@eeckstein
Copy link
Contributor Author

@swift-ci Please smoke test

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (0)

Improvement (4)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 101312 95355 -5.9% 1.06x
ObjectiveCBridgeStubFromArrayOfNSString 65868 62383 -5.3% 1.06x(?)
ClassArrayGetter 13 12 -7.7% 1.08x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 171540 159480 -7.0% 1.08x(?)

No Changes (132)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeFromNSArrayAnyObjectToString 127347 124072 -2.6% 1.03x(?)
ObjectiveCBridgeStubURLAppendPathRef 245993 239610 -2.6% 1.03x(?)
ErrorHandling 2969 2922 -1.6% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObject 84291 82564 -2.0% 1.02x(?)
135 3320148 3278904 -1.2% 1.01x
DictionaryBridge 4105 4080 -0.6% 1.01x(?)
RangeAssignment 327 324 -0.9% 1.01x(?)
ObjectAllocation 153 152 -0.7% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObject 313216 309723 -1.1% 1.01x(?)
ObjectiveCBridgeStubToArrayOfNSString 31036 30780 -0.8% 1.01x(?)
ObjectiveCBridgeToNSDictionary 18006 17796 -1.2% 1.01x(?)
DictionaryRemove 5130 5084 -0.9% 1.01x(?)
NSStringConversion 872 865 -0.8% 1.01x(?)
ArraySubscript 1431 1435 +0.3% 1.00x(?)
ObjectiveCBridgeToNSString 1070 1067 -0.3% 1.00x
DictionarySwapOfObjects 6858 6873 +0.2% 1.00x(?)
StackPromo 19875 19875 +0.0% 1.00x
RecursiveOwnedParameter 1938 1937 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1282 1283 +0.1% 1.00x(?)
Array2D 1967 1961 -0.3% 1.00x(?)
Histogram 683 682 -0.1% 1.00x(?)
SortStrings 1765 1766 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5144 5148 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3688 3687 -0.0% 1.00x
MonteCarloPi 45040 45021 -0.0% 1.00x(?)
StringWithCString 153112 152957 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6947 6916 -0.5% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2645 2642 -0.1% 1.00x(?)
Prims 793 796 +0.4% 1.00x(?)
SortLettersInPlace 1001 1005 +0.4% 1.00x
DictionarySwap 785 786 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSString 1835 1837 +0.1% 1.00x(?)
PopFrontArray 1139 1135 -0.3% 1.00x
ArrayOfGenericPOD 220 220 +0.0% 1.00x
Dictionary3OfObjects 899 901 +0.2% 1.00x(?)
StringHasPrefix 648 647 -0.1% 1.00x(?)
ByteSwap 1 1 +0.0% 1.00x
SuperChars 214498 214682 +0.1% 1.00x(?)
XorLoop 381 380 -0.3% 1.00x
Integrate 238 238 +0.0% 1.00x
ObjectiveCBridgeStubFromNSString 850 850 +0.0% 1.00x
ProtocolDispatch 3040 3040 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ArrayLiteral 1025 1026 +0.1% 1.00x(?)
ProtocolDispatch2 156 156 +0.0% 1.00x
Walsh 343 343 +0.0% 1.00x
Dictionary3 537 537 +0.0% 1.00x
Dictionary2 2098 2097 -0.1% 1.00x(?)
StrComplexWalk 2920 2929 +0.3% 1.00x(?)
SetIntersect_OfObjects 2413 2410 -0.1% 1.00x(?)
Join 463 465 +0.4% 1.00x(?)
ArrayOfRef 3534 3548 +0.4% 1.00x(?)
ObjectiveCBridgeStubDateMutation 273 273 +0.0% 1.00x
DictionaryOfObjects 2364 2360 -0.2% 1.00x(?)
PopFrontArrayGeneric 1135 1138 +0.3% 1.00x(?)
StringEqualPointerComparison 7272 7267 -0.1% 1.00x(?)
CaptureProp 4315 4314 -0.0% 1.00x(?)
PolymorphicCalls 15 15 +0.0% 1.00x
RC4 266 266 +0.0% 1.00x
Calculator 35 35 +0.0% 1.00x
MapReduce 374 374 +0.0% 1.00x
AngryPhonebook 2840 2840 +0.0% 1.00x
IterateData 2546 2547 +0.0% 1.00x(?)
Hanoi 3430 3427 -0.1% 1.00x(?)
OpenClose 51 51 +0.0% 1.00x
DictionaryRemoveOfObjects 20650 20622 -0.1% 1.00x
UTF8Decode 323 323 +0.0% 1.00x
SortStringsUnicode 7937 7946 +0.1% 1.00x(?)
SetIsSubsetOf 515 515 +0.0% 1.00x
Dictionary 797 797 +0.0% 1.00x
NopDeinit 36657 36645 -0.0% 1.00x(?)
SetIntersect 1184 1188 +0.3% 1.00x(?)
SetExclusiveOr 3938 3939 +0.0% 1.00x(?)
NSDictionaryCastToSwift 13762 13712 -0.4% 1.00x(?)
RGBHistogramOfObjects 22489 22483 -0.0% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 338 338 +0.0% 1.00x
StrToInt 5022 5024 +0.0% 1.00x(?)
ArrayOfGenericRef 3619 3612 -0.2% 1.00x(?)
StringHasSuffix 677 677 +0.0% 1.00x
Phonebook 7137 7135 -0.0% 1.00x(?)
ObjectiveCBridgeStubDateAccess 182 182 +0.0% 1.00x
Sim2DArray 436 436 +0.0% 1.00x
SetExclusiveOr_OfObjects 8548 8556 +0.1% 1.00x(?)
MonteCarloE 10484 10478 -0.1% 1.00x(?)
SetUnion_OfObjects 7169 7146 -0.3% 1.00x
StringHasSuffixUnicode 63399 63446 +0.1% 1.00x(?)
HashTest 1741 1741 +0.0% 1.00x
ArrayAppend 772 774 +0.3% 1.00x(?)
StringHasPrefixUnicode 14506 14504 -0.0% 1.00x(?)
LinkedList 7211 7207 -0.1% 1.00x(?)
RGBHistogram 3188 3173 -0.5% 1.00x(?)
ArrayValueProp4 6 6 +0.0% 1.00x
ArrayOfPOD 182 182 +0.0% 1.00x
SetUnion 2770 2762 -0.3% 1.00x(?)
Chars 605 605 +0.0% 1.00x
StringBuilder 1316 1315 -0.1% 1.00x(?)
DeadArray 185 185 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
SevenBoom 1377 1379 +0.1% 1.00x(?)
StringWalk 5870 5869 -0.0% 1.00x(?)
ArrayValueProp 6 6 +0.0% 1.00x
GlobalClass 0 0 +0.0% 1.00x
Memset 235 235 +0.0% 1.00x
Dictionary2OfObjects 3513 3499 -0.4% 1.00x(?)
ArrayAppendReserved 537 537 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDate 3761 3767 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 256874 259159 +0.9% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 234838 237306 +1.1% 0.99x(?)
ObjectiveCBridgeStubToNSDate 13188 13368 +1.4% 0.99x(?)
StringInterpolation 10717 10805 +0.8% 0.99x(?)
ObjectiveCBridgeStubFromNSStringRef 132 134 +1.5% 0.99x(?)
StaticArray 2801 2816 +0.5% 0.99x(?)
ObjectiveCBridgeToNSSet 16618 16791 +1.0% 0.99x(?)
ObjectiveCBridgeToNSArray 31798 32268 +1.5% 0.99x(?)
NSError 339 341 +0.6% 0.99x(?)
ObjectiveCBridgeStubToNSDateRef 3441 3466 +0.7% 0.99x(?)
PopFrontUnsafePointer 9145 9199 +0.6% 0.99x(?)
ObjectiveCBridgeStubToNSStringRef 124 125 +0.8% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 158122 159705 +1.0% 0.99x(?)
ObjectiveCBridgeStubDataAppend 2938 2962 +0.8% 0.99x
ArrayInClass 86 87 +1.2% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4277 4309 +0.8% 0.99x
TwoSum 1946 1958 +0.6% 0.99x(?)
ObjectiveCBridgeStubNSDataAppend 2417 2445 +1.2% 0.99x
DictionaryLiteral 4650 4748 +2.1% 0.98x(?)
SetIsSubsetOf_OfObjects 511 521 +2.0% 0.98x
AnyHashableWithAClass 66801 68334 +2.3% 0.98x(?)
ObjectiveCBridgeStubNSDateMutationRef 12013 12344 +2.8% 0.97x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 120202 125854 +4.7% 0.96x(?)
ObjectiveCBridgeStubURLAppendPath 235181 248438 +5.6% 0.95x
**Unoptimized (Onone)**

Regression (0)

Improvement (1)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
TypeFlood 169 155 -8.3% 1.09x

No Changes (135)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 143687 136571 -5.0% 1.05x(?)
ObjectiveCBridgeStubNSDateMutationRef 14656 14075 -4.0% 1.04x(?)
MapReduce 47668 46829 -1.8% 1.02x(?)
DictionaryLiteral 25591 25176 -1.6% 1.02x(?)
Phonebook 63337 61855 -2.3% 1.02x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 181330 177662 -2.0% 1.02x(?)
StackPromo 132099 131068 -0.8% 1.01x(?)
DictionarySwap 10924 10859 -0.6% 1.01x(?)
PopFrontArray 25133 24959 -0.7% 1.01x(?)
StaticArray 27729 27433 -1.1% 1.01x
OpenClose 462 458 -0.9% 1.01x(?)
ObjectiveCBridgeStubURLAppendPath 243149 240042 -1.3% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3306 3280 -0.8% 1.01x(?)
LinkedList 27925 27656 -1.0% 1.01x
StringBuilder 2752 2727 -0.9% 1.01x(?)
DeadArray 120802 119185 -1.3% 1.01x
StringHasSuffix 1638 1622 -1.0% 1.01x(?)
Dictionary2OfObjects 6965 6927 -0.6% 1.01x(?)
ArraySubscript 5751 5758 +0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1108 1109 +0.1% 1.00x(?)
DictionarySwapOfObjects 25727 25761 +0.1% 1.00x(?)
135 5933501 5935728 +0.0% 1.00x
RecursiveOwnedParameter 10620 10619 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSString 1346 1346 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 247497 247843 +0.1% 1.00x(?)
ClassArrayGetter 1334 1333 -0.1% 1.00x(?)
Array2D 843382 844143 +0.1% 1.00x
SortStrings 2686 2685 -0.0% 1.00x(?)
DictionaryBridge 4196 4181 -0.4% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 4074 4071 -0.1% 1.00x(?)
MonteCarloPi 53565 53545 -0.0% 1.00x(?)
StringWithCString 155767 155770 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 3073 3078 +0.2% 1.00x
Prims 15256 15210 -0.3% 1.00x
SortLettersInPlace 2618 2620 +0.1% 1.00x(?)
Dictionary3OfObjects 2685 2690 +0.2% 1.00x(?)
RangeAssignment 24107 24140 +0.1% 1.00x(?)
StringHasPrefix 1569 1568 -0.1% 1.00x(?)
ByteSwap 10 10 +0.0% 1.00x
SuperChars 264369 264238 -0.1% 1.00x(?)
XorLoop 19645 19634 -0.1% 1.00x(?)
StringInterpolation 15448 15490 +0.3% 1.00x(?)
Integrate 361 361 +0.0% 1.00x
ObjectiveCBridgeStubFromNSString 899 898 -0.1% 1.00x(?)
ProtocolDispatch 5826 5824 -0.0% 1.00x(?)
ObjectAllocation 556 555 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 326995 325603 -0.4% 1.00x(?)
ArrayLiteral 1124 1124 +0.0% 1.00x
ProtocolDispatch2 440 441 +0.2% 1.00x
Walsh 13043 13058 +0.1% 1.00x(?)
Dictionary3 2048 2048 +0.0% 1.00x
Dictionary2 5049 5052 +0.1% 1.00x(?)
StrComplexWalk 7609 7627 +0.2% 1.00x(?)
SetIntersect_OfObjects 20163 20190 +0.1% 1.00x(?)
Join 1514 1513 -0.1% 1.00x(?)
ArrayOfRef 9359 9365 +0.1% 1.00x(?)
ObjectiveCBridgeStubDateMutation 517 516 -0.2% 1.00x
DictionaryOfObjects 5577 5583 +0.1% 1.00x(?)
PopFrontArrayGeneric 9821 9816 -0.1% 1.00x(?)
PopFrontUnsafePointer 242850 242998 +0.1% 1.00x(?)
StringEqualPointerComparison 9729 9742 +0.1% 1.00x(?)
CaptureProp 115814 115792 -0.0% 1.00x(?)
PolymorphicCalls 1134 1137 +0.3% 1.00x(?)
RC4 9067 9071 +0.0% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 165 165 +0.0% 1.00x
Calculator 917 917 +0.0% 1.00x
AngryPhonebook 3028 3032 +0.1% 1.00x(?)
IterateData 10634 10631 -0.0% 1.00x(?)
Hanoi 20009 20005 -0.0% 1.00x(?)
ArrayOfGenericPOD 3713 3711 -0.1% 1.00x(?)
DictionaryRemoveOfObjects 62469 62517 +0.1% 1.00x(?)
UTF8Decode 45109 45105 -0.0% 1.00x(?)
SortStringsUnicode 9237 9240 +0.0% 1.00x(?)
SetIsSubsetOf 3169 3164 -0.2% 1.00x(?)
Dictionary 2720 2721 +0.0% 1.00x(?)
NopDeinit 59699 59781 +0.1% 1.00x
SetIntersect 20169 20165 -0.0% 1.00x(?)
SetExclusiveOr 45784 45753 -0.1% 1.00x(?)
NSDictionaryCastToSwift 15164 15232 +0.5% 1.00x(?)
RGBHistogramOfObjects 103733 104030 +0.3% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1230 1228 -0.2% 1.00x(?)
StrToInt 5351 5354 +0.1% 1.00x(?)
ArrayInClass 3865 3866 +0.0% 1.00x(?)
ArrayOfGenericRef 10018 10008 -0.1% 1.00x(?)
ObjectiveCBridgeStubDateAccess 1128 1128 +0.0% 1.00x
Sim2DArray 14624 14621 -0.0% 1.00x(?)
SetExclusiveOr_OfObjects 66279 66243 -0.1% 1.00x(?)
MonteCarloE 112794 112623 -0.1% 1.00x(?)
StringHasSuffixUnicode 65024 64865 -0.2% 1.00x
HashTest 5350 5360 +0.2% 1.00x(?)
SetIsSubsetOf_OfObjects 3022 3020 -0.1% 1.00x(?)
ArrayAppend 3684 3684 +0.0% 1.00x
StringHasPrefixUnicode 15204 15180 -0.2% 1.00x(?)
NSStringConversion 3025 3029 +0.1% 1.00x(?)
RGBHistogram 52582 52489 -0.2% 1.00x(?)
ArrayValueProp4 2689 2685 -0.1% 1.00x(?)
ArrayOfPOD 2452 2452 +0.0% 1.00x
SetUnion 30925 30877 -0.2% 1.00x(?)
Chars 5334 5332 -0.0% 1.00x(?)
ArrayValueProp2 2848 2845 -0.1% 1.00x(?)
BitCount 91 91 +0.0% 1.00x
AnyHashableWithAClass 76168 76168 +0.0% 1.00x
SevenBoom 1531 1526 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 99160 99194 +0.0% 1.00x(?)
ArrayValueProp 2348 2353 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromArrayOfNSString 65285 65200 -0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 20665 20676 +0.1% 1.00x(?)
ArrayAppendReserved 3301 3301 +0.0% 1.00x
TwoSum 9286 9251 -0.4% 1.00x(?)
ArrayValueProp3 2748 2753 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3977 3967 -0.2% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObject 258746 262090 +1.3% 0.99x(?)
Histogram 13630 13730 +0.7% 0.99x(?)
ObjectiveCBridgeStubToNSDate 14085 14289 +1.4% 0.99x(?)
ErrorHandling 3701 3740 +1.1% 0.99x(?)
ObjectiveCBridgeStubFromNSStringRef 170 172 +1.2% 0.99x(?)
ObjectiveCBridgeToNSArray 31941 32179 +0.8% 0.99x(?)
ObjectiveCBridgeStubToNSDateRef 3313 3334 +0.6% 0.99x(?)
ObjectiveCBridgeStubToArrayOfNSString 30831 31014 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSString 5158 5196 +0.7% 0.99x(?)
ObjectiveCBridgeToNSDictionary 18120 18381 +1.4% 0.99x(?)
SetUnion_OfObjects 49432 49752 +0.7% 0.99x(?)
DictionaryRemove 30763 30928 +0.5% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7497 7566 +0.9% 0.99x(?)
ObjectiveCBridgeStubNSDataAppend 2807 2832 +0.9% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 126681 128611 +1.5% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7651 7826 +2.3% 0.98x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 11304 11624 +2.8% 0.97x(?)
ObjectiveCBridgeStubURLAppendPathRef 237259 244301 +3.0% 0.97x(?)
ObjectiveCBridgeToNSSet 16329 16755 +2.6% 0.97x(?)
NSError 667 687 +3.0% 0.97x(?)
ObjectiveCBridgeFromNSArrayAnyObject 82750 85145 +2.9% 0.97x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 162273 168702 +4.0% 0.96x(?)
StringWalk 22206 23339 +5.1% 0.95x(?)
**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: 8 GB

@eeckstein eeckstein merged commit d6a039d into swiftlang:master Aug 31, 2016
@eeckstein eeckstein deleted the builtin-arc branch August 31, 2016 21:20
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.

2 participants