-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Move DCE to later in the SSA passes. #2145
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
Conversation
Doing it later doesn't get in the way of other optimizations, and could result in removing more things that become dead in the meantime.
@swift-ci Please test and benchmark. |
@swift-ci Please test |
@swift-ci Please benchmark |
Build comment file:Optimized (O)
|
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
Calculator | 34 | 38 | +11.8% | 0.89x |
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 159537 | 171464 | +7.5% | 0.93x(?) |
Improvement (1)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
PopFrontArray | 1270 | 1097 | -13.6% | 1.16x(?) |
No Changes (112)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSDictionaryAnyObject | 190467 | 183113 | -3.9% | 1.04x(?) |
Walsh | 330 | 317 | -3.9% | 1.04x |
ErrorHandling | 3098 | 2996 | -3.3% | 1.03x(?) |
ObjectiveCBridgeToNSSet | 16164 | 15766 | -2.5% | 1.03x(?) |
ArraySubscript | 1349 | 1325 | -1.8% | 1.02x |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 166359 | 162550 | -2.3% | 1.02x(?) |
AngryPhonebook | 3663 | 3608 | -1.5% | 1.02x(?) |
Join | 442 | 435 | -1.6% | 1.02x |
Integrate | 233 | 229 | -1.7% | 1.02x |
Dictionary | 983 | 963 | -2.0% | 1.02x |
ObjectiveCBridgeToNSDictionary | 16870 | 16606 | -1.6% | 1.02x(?) |
HashTest | 1892 | 1862 | -1.6% | 1.02x |
StaticArray | 2667 | 2629 | -1.4% | 1.01x(?) |
StrComplexWalk | 2921 | 2892 | -1.0% | 1.01x(?) |
ObjectiveCBridgeToNSArray | 30059 | 29677 | -1.3% | 1.01x |
DictionaryLiteral | 3340 | 3292 | -1.4% | 1.01x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 29830 | 29473 | -1.2% | 1.01x(?) |
NSDictionaryCastToSwift | 8487 | 8374 | -1.3% | 1.01x(?) |
ArrayInClass | 84 | 83 | -1.2% | 1.01x(?) |
MonteCarloE | 10093 | 10016 | -0.8% | 1.01x |
ArrayAppendReserved | 510 | 507 | -0.6% | 1.01x |
Chars | 671 | 666 | -0.8% | 1.01x(?) |
Dictionary2OfObjects | 4023 | 3987 | -0.9% | 1.01x |
ObjectiveCBridgeToNSString | 1034 | 1039 | +0.5% | 1.00x(?) |
StackPromo | 19292 | 19219 | -0.4% | 1.00x(?) |
RecursiveOwnedParameter | 1826 | 1825 | -0.1% | 1.00x(?) |
ObjectiveCBridgeStubToNSString | 1376 | 1376 | +0.0% | 1.00x |
ClassArrayGetter | 12 | 12 | +0.0% | 1.00x |
Array2D | 1990 | 1988 | -0.1% | 1.00x(?) |
Histogram | 659 | 656 | -0.5% | 1.00x |
SortStrings | 1727 | 1734 | +0.4% | 1.00x |
DictionaryBridge | 3638 | 3630 | -0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 4643 | 4658 | +0.3% | 1.00x(?) |
MonteCarloPi | 42663 | 42681 | +0.0% | 1.00x(?) |
StringWithCString | 81003 | 80955 | -0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 3628 | 3625 | -0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSStringForced | 2205 | 2213 | +0.4% | 1.00x(?) |
Prims | 741 | 740 | -0.1% | 1.00x(?) |
DictionarySwap | 774 | 776 | +0.3% | 1.00x(?) |
ArrayOfGenericPOD | 208 | 208 | +0.0% | 1.00x |
Dictionary3OfObjects | 1181 | 1182 | +0.1% | 1.00x(?) |
RangeAssignment | 271 | 272 | +0.4% | 1.00x |
ByteSwap | 1 | 1 | +0.0% | 1.00x |
SuperChars | 286017 | 286892 | +0.3% | 1.00x |
XorLoop | 359 | 359 | +0.0% | 1.00x |
StringInterpolation | 10378 | 10339 | -0.4% | 1.00x(?) |
ObjectiveCBridgeStubFromNSStringRef | 326 | 327 | +0.3% | 1.00x |
ProtocolDispatch | 2884 | 2876 | -0.3% | 1.00x(?) |
TypeFlood | 0 | 0 | +0.0% | 1.00x |
Dictionary3 | 730 | 728 | -0.3% | 1.00x(?) |
Dictionary2 | 2476 | 2472 | -0.2% | 1.00x |
SetIntersect_OfObjects | 2737 | 2739 | +0.1% | 1.00x(?) |
ArrayOfRef | 3420 | 3432 | +0.3% | 1.00x(?) |
NSError | 353 | 352 | -0.3% | 1.00x(?) |
DictionaryOfObjects | 2701 | 2706 | +0.2% | 1.00x(?) |
PopFrontArrayGeneric | 1253 | 1250 | -0.2% | 1.00x(?) |
PopFrontUnsafePointer | 8514 | 8521 | +0.1% | 1.00x(?) |
CaptureProp | 3760 | 3759 | -0.0% | 1.00x(?) |
PolymorphicCalls | 61 | 61 | +0.0% | 1.00x |
OpenClose | 49 | 49 | +0.0% | 1.00x |
UTF8Decode | 255 | 256 | +0.4% | 1.00x |
SetIsSubsetOf | 477 | 477 | +0.0% | 1.00x |
NopDeinit | 34562 | 34596 | +0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObject | 62310 | 62385 | +0.1% | 1.00x(?) |
SetExclusiveOr | 3763 | 3757 | -0.2% | 1.00x(?) |
RGBHistogramOfObjects | 22364 | 22355 | -0.0% | 1.00x(?) |
StrToInt | 3715 | 3703 | -0.3% | 1.00x(?) |
ArrayOfGenericRef | 3501 | 3513 | +0.3% | 1.00x(?) |
Phonebook | 9521 | 9552 | +0.3% | 1.00x |
Sim2DArray | 407 | 405 | -0.5% | 1.00x(?) |
RC4 | 249 | 249 | +0.0% | 1.00x |
SetIsSubsetOf_OfObjects | 539 | 539 | +0.0% | 1.00x |
ArrayAppend | 730 | 730 | +0.0% | 1.00x |
DictionaryRemove | 4829 | 4849 | +0.4% | 1.00x(?) |
LinkedList | 8916 | 8930 | +0.2% | 1.00x(?) |
RGBHistogram | 3385 | 3379 | -0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSSetAnyObjectForced | 4010 | 4030 | +0.5% | 1.00x |
SetUnion | 3253 | 3260 | +0.2% | 1.00x(?) |
StringBuilder | 1423 | 1420 | -0.2% | 1.00x |
DeadArray | 176 | 176 | +0.0% | 1.00x |
BitCount | 1 | 1 | +0.0% | 1.00x |
ArrayLiteral | 985 | 983 | -0.2% | 1.00x |
SevenBoom | 1273 | 1275 | +0.2% | 1.00x(?) |
StringWalk | 6422 | 6431 | +0.1% | 1.00x(?) |
ArrayValueProp | 5 | 5 | +0.0% | 1.00x |
ObjectiveCBridgeStubFromArrayOfNSString | 115932 | 115564 | -0.3% | 1.00x(?) |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Memset | 222 | 222 | +0.0% | 1.00x |
ArrayValueProp4 | 5 | 5 | +0.0% | 1.00x |
TwoSum | 1728 | 1732 | +0.2% | 1.00x(?) |
ArrayValueProp2 | 5 | 5 | +0.0% | 1.00x |
ArrayValueProp3 | 5 | 5 | +0.0% | 1.00x |
DictionarySwapOfObjects | 7267 | 7315 | +0.7% | 0.99x |
SortLettersInPlace | 993 | 1000 | +0.7% | 0.99x(?) |
114 | 2259147 | 2281874 | +1.0% | 0.99x |
ObjectiveCBridgeStubFromNSString | 705 | 711 | +0.8% | 0.99x |
ObjectAllocation | 141 | 142 | +0.7% | 0.99x(?) |
ProtocolDispatch2 | 151 | 153 | +1.3% | 0.99x |
MapReduce | 328 | 332 | +1.2% | 0.99x |
Hanoi | 3400 | 3419 | +0.6% | 0.99x |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 128846 | 129944 | +0.8% | 0.99x(?) |
SetIntersect | 1130 | 1138 | +0.7% | 0.99x(?) |
ObjectiveCBridgeFromNSString | 1526 | 1536 | +0.7% | 0.99x(?) |
SetExclusiveOr_OfObjects | 8827 | 8922 | +1.1% | 0.99x |
SetUnion_OfObjects | 7012 | 7076 | +0.9% | 0.99x |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 108589 | 109214 | +0.6% | 0.99x(?) |
ArrayOfPOD | 171 | 172 | +0.6% | 0.99x |
ObjectiveCBridgeFromNSSetAnyObject | 93590 | 95218 | +1.7% | 0.98x(?) |
DictionaryRemoveOfObjects | 19690 | 20166 | +2.4% | 0.98x |
ObjectiveCBridgeFromNSSetAnyObjectToString | 180338 | 184499 | +2.3% | 0.98x(?) |
NSStringConversion | 594 | 606 | +2.0% | 0.98x |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 182815 | 191530 | +4.8% | 0.95x(?) |
Regression (1)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
StrComplexWalk | 7322 | 7754 | +5.9% | 0.94x |
Improvement (0)
No Changes (114)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 171657 | 163932 | -4.5% | 1.05x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 168432 | 162510 | -3.5% | 1.04x(?) |
ArrayOfPOD | 2318 | 2230 | -3.8% | 1.04x |
ObjectiveCBridgeStubFromArrayOfNSString | 120385 | 115997 | -3.6% | 1.04x |
ArrayOfGenericPOD | 3521 | 3416 | -3.0% | 1.03x |
ObjectiveCBridgeToNSArray | 29728 | 29056 | -2.3% | 1.02x(?) |
CaptureProp | 55495 | 54330 | -2.1% | 1.02x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 121105 | 118617 | -2.0% | 1.02x |
DictionaryBridge | 3783 | 3730 | -1.4% | 1.01x(?) |
ProtocolDispatch2 | 421 | 416 | -1.2% | 1.01x(?) |
HashTest | 6109 | 6077 | -0.5% | 1.01x(?) |
PolymorphicCalls | 1147 | 1132 | -1.3% | 1.01x |
Calculator | 936 | 931 | -0.5% | 1.01x |
DictionaryRemoveOfObjects | 60898 | 60581 | -0.5% | 1.01x(?) |
Dictionary | 4301 | 4275 | -0.6% | 1.01x(?) |
ObjectiveCBridgeFromNSString | 4898 | 4857 | -0.8% | 1.01x(?) |
StrToInt | 18718 | 18576 | -0.8% | 1.01x |
DeadArray | 133134 | 131876 | -0.9% | 1.01x(?) |
BitCount | 77 | 76 | -1.3% | 1.01x |
ArrayValueProp3 | 2592 | 2566 | -1.0% | 1.01x |
ArrayValueProp | 2232 | 2217 | -0.7% | 1.01x |
Dictionary2OfObjects | 6975 | 6937 | -0.5% | 1.01x(?) |
ArraySubscript | 4449 | 4438 | -0.2% | 1.00x(?) |
ObjectiveCBridgeToNSString | 1046 | 1044 | -0.2% | 1.00x |
DictionarySwapOfObjects | 26094 | 26082 | -0.1% | 1.00x(?) |
RecursiveOwnedParameter | 10316 | 10318 | +0.0% | 1.00x(?) |
Integrate | 345 | 344 | -0.3% | 1.00x(?) |
ClassArrayGetter | 1266 | 1265 | -0.1% | 1.00x(?) |
Array2D | 698117 | 698348 | +0.0% | 1.00x |
Histogram | 13949 | 13957 | +0.1% | 1.00x(?) |
SortStrings | 5640 | 5614 | -0.5% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 6954 | 6972 | +0.3% | 1.00x(?) |
MonteCarloPi | 50277 | 50216 | -0.1% | 1.00x(?) |
StringWithCString | 535008 | 533734 | -0.2% | 1.00x |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 7000 | 6967 | -0.5% | 1.00x(?) |
ObjectiveCBridgeFromNSStringForced | 2612 | 2622 | +0.4% | 1.00x |
Prims | 13708 | 13664 | -0.3% | 1.00x(?) |
SortLettersInPlace | 2288 | 2295 | +0.3% | 1.00x(?) |
Dictionary3OfObjects | 2727 | 2726 | -0.0% | 1.00x(?) |
SetUnion_OfObjects | 51226 | 51282 | +0.1% | 1.00x |
RangeAssignment | 15666 | 15675 | +0.1% | 1.00x(?) |
ByteSwap | 9 | 9 | +0.0% | 1.00x |
SuperChars | 697323 | 695125 | -0.3% | 1.00x(?) |
XorLoop | 18451 | 18462 | +0.1% | 1.00x(?) |
StringInterpolation | 13836 | 13785 | -0.4% | 1.00x(?) |
ObjectiveCBridgeStubToNSString | 1674 | 1669 | -0.3% | 1.00x(?) |
ObjectiveCBridgeStubFromNSStringRef | 653 | 653 | +0.0% | 1.00x |
ObjectiveCBridgeStubFromNSString | 1110 | 1111 | +0.1% | 1.00x(?) |
StaticArray | 16916 | 16894 | -0.1% | 1.00x(?) |
ProtocolDispatch | 5589 | 5601 | +0.2% | 1.00x(?) |
ObjectAllocation | 1293 | 1297 | +0.3% | 1.00x(?) |
Dictionary3 | 2102 | 2104 | +0.1% | 1.00x(?) |
Dictionary2 | 5176 | 5194 | +0.3% | 1.00x(?) |
SetIntersect_OfObjects | 18913 | 18911 | -0.0% | 1.00x(?) |
Join | 1338 | 1342 | +0.3% | 1.00x |
ArrayOfRef | 9945 | 9937 | -0.1% | 1.00x |
NSError | 634 | 633 | -0.2% | 1.00x(?) |
PopFrontArrayGeneric | 12530 | 12576 | +0.4% | 1.00x(?) |
PopFrontUnsafePointer | 94725 | 94824 | +0.1% | 1.00x(?) |
MapReduce | 43191 | 43205 | +0.0% | 1.00x(?) |
DictionaryLiteral | 20239 | 20285 | +0.2% | 1.00x(?) |
Hanoi | 22747 | 22659 | -0.4% | 1.00x |
UTF8Decode | 39222 | 39231 | +0.0% | 1.00x(?) |
SetIsSubsetOf | 3082 | 3069 | -0.4% | 1.00x |
NopDeinit | 52895 | 52748 | -0.3% | 1.00x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 30197 | 30339 | +0.5% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObject | 66283 | 66089 | -0.3% | 1.00x(?) |
SetIntersect | 18806 | 18824 | +0.1% | 1.00x(?) |
SetExclusiveOr | 48490 | 48708 | +0.5% | 1.00x |
NSDictionaryCastToSwift | 9661 | 9699 | +0.4% | 1.00x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToString | 193238 | 193536 | +0.1% | 1.00x(?) |
ArrayInClass | 3646 | 3646 | +0.0% | 1.00x |
ArrayOfGenericRef | 10551 | 10553 | +0.0% | 1.00x(?) |
Phonebook | 58643 | 58904 | +0.5% | 1.00x(?) |
Sim2DArray | 13148 | 13139 | -0.1% | 1.00x(?) |
SetExclusiveOr_OfObjects | 67035 | 67120 | +0.1% | 1.00x(?) |
MonteCarloE | 93251 | 93150 | -0.1% | 1.00x |
114 | 5389557 | 5404032 | +0.3% | 1.00x |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Walsh | 12243 | 12251 | +0.1% | 1.00x(?) |
SetIsSubsetOf_OfObjects | 2922 | 2922 | +0.0% | 1.00x |
DictionaryRemove | 30461 | 30318 | -0.5% | 1.00x(?) |
RGBHistogramOfObjects | 97766 | 97716 | -0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSSetAnyObjectForced | 7411 | 7417 | +0.1% | 1.00x(?) |
ArrayValueProp4 | 2525 | 2526 | +0.0% | 1.00x(?) |
SetUnion | 34866 | 34814 | -0.1% | 1.00x(?) |
Chars | 54686 | 54471 | -0.4% | 1.00x(?) |
ArrayLiteral | 1033 | 1031 | -0.2% | 1.00x |
Memset | 20655 | 20636 | -0.1% | 1.00x |
ArrayAppendReserved | 2662 | 2668 | +0.2% | 1.00x(?) |
ArrayValueProp2 | 18198 | 18231 | +0.2% | 1.00x(?) |
SevenBoom | 1422 | 1423 | +0.1% | 1.00x(?) |
StackPromo | 80294 | 80725 | +0.5% | 0.99x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObject | 189028 | 190405 | +0.7% | 0.99x(?) |
PopFrontArray | 12463 | 12562 | +0.8% | 0.99x(?) |
ErrorHandling | 7191 | 7231 | +0.6% | 0.99x(?) |
TypeFlood | 151 | 153 | +1.3% | 0.99x(?) |
ObjectiveCBridgeFromNSSetAnyObject | 99797 | 100506 | +0.7% | 0.99x(?) |
AngryPhonebook | 6034 | 6098 | +1.1% | 0.99x |
ArrayAppend | 2872 | 2895 | +0.8% | 0.99x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 133263 | 134064 | +0.6% | 0.99x(?) |
ObjectiveCBridgeToNSDictionary | 16528 | 16746 | +1.3% | 0.99x(?) |
LinkedList | 26294 | 26427 | +0.5% | 0.99x(?) |
NSStringConversion | 2573 | 2594 | +0.8% | 0.99x(?) |
RGBHistogram | 49562 | 50030 | +0.9% | 0.99x |
StringWalk | 47927 | 48261 | +0.7% | 0.99x |
RC4 | 8756 | 8801 | +0.5% | 0.99x(?) |
TwoSum | 9334 | 9471 | +1.5% | 0.99x |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 190182 | 194848 | +2.5% | 0.98x(?) |
DictionarySwap | 11074 | 11296 | +2.0% | 0.98x(?) |
DictionaryOfObjects | 7042 | 7181 | +2.0% | 0.98x(?) |
ObjectiveCBridgeToNSSet | 16234 | 16621 | +2.4% | 0.98x(?) |
StringBuilder | 8251 | 8514 | +3.2% | 0.97x(?) |
OpenClose | 416 | 440 | +5.8% | 0.95x |
I'm unable to reproduce the regressions listed here. I was seeing a different regression with an ObjectiveCBridge* benchmark, but only in the larger run I did - not when I run the benchmark standalone against the baseline. |
What's in this pull request?
Move DCE later during the SSA passes.
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Note: Only members of the Apple organization can trigger swift-ci.
Doing it later doesn't get in the way of other optimizations, and could
result in removing more things that become dead in the meantime.