Skip to content

Enable DCE on OSSA #35530

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
Jan 21, 2021
Merged

Enable DCE on OSSA #35530

merged 1 commit into from
Jan 21, 2021

Conversation

meg-gupta
Copy link
Contributor

  • Support destroy_value/copy_value/begin_borrow/end_borrow
  • Support adding reverse dependencies for SILArgument
  • Insert lifetime end instructions (destroy_value/end_borrow) while deleting instructions which would have ended the lifetime of its operands

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci test source compatibility

@meg-gupta
Copy link
Contributor Author

@swift-ci benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
StringFromLongWholeSubstring 4 5 +25.0% 0.80x
UTF8Decode_InitFromBytes_ascii_as_ascii 445 520 +16.9% 0.86x (?)
ArrayInitFromSlice 458 517 +12.9% 0.89x (?)
LessSubstringSubstringGenericComparable 39 43 +10.3% 0.91x
DataSetCountSmall 131 142 +8.4% 0.92x (?)
EqualSubstringString 39 42 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
StringWalk 2560 1280 -50.0% 2.00x
String.data.LargeUnicode 126 100 -20.6% 1.26x (?)
HashTest 1580 1260 -20.3% 1.25x (?)
StrComplexWalk 2840 2310 -18.7% 1.23x
CSVParsingAlt2 1716 1474 -14.1% 1.16x
RemoveWhereFilterString 342 300 -12.3% 1.14x
String.replaceSubrange.Substring.Small 84 75 -10.7% 1.12x (?)
String.replaceSubrange.String.Small 67 60 -10.4% 1.12x (?)
CharIteration_russian_unicodeScalars 3840 3440 -10.4% 1.12x (?)
StringBuilderLong 1460 1310 -10.3% 1.11x (?)
StringBuilderWithLongSubstring 1730 1590 -8.1% 1.09x (?)
ObjectiveCBridgeStringHash 136 125 -8.1% 1.09x (?)
CSVParsing.Scalar 201 185 -8.0% 1.09x (?)
Data.hash.Empty 77 71 -7.8% 1.08x (?)
RandomShuffleLCG2 480 448 -6.7% 1.07x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
StrComplexWalk.o 2578 2642 +2.5% 0.98x

Performance: -Osize

Regression OLD NEW DELTA RATIO
StringFromLongWholeSubstring 4 5 +25.0% 0.80x
ArrayInitFromSlice 458 525 +14.6% 0.87x (?)
PrefixWhileAnySequenceLazy 1580 1792 +13.4% 0.88x (?)
CharIteration_korean_unicodeScalars 3880 4360 +12.4% 0.89x (?)
CharIteration_japanese_unicodeScalars 5280 5840 +10.6% 0.90x (?)
LessSubstringSubstring 39 43 +10.3% 0.91x
LessSubstringSubstringGenericComparable 39 43 +10.3% 0.91x
CharIteration_chinese_unicodeScalars 3160 3440 +8.9% 0.92x
DataSetCountSmall 134 145 +8.2% 0.92x
EqualSubstringSubstring 39 42 +7.7% 0.93x (?)
EqualStringSubstring 39 42 +7.7% 0.93x (?)
EqualSubstringSubstringGenericEquatable 39 42 +7.7% 0.93x
EqualSubstringString 39 42 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
StringWalk 6080 2160 -64.5% 2.81x
FlattenListLoop 2520 1630 -35.3% 1.55x (?)
HashTest 1660 1320 -20.5% 1.26x
CSVParsingAlt2 1826 1540 -15.7% 1.19x
String.replaceSubrange.Substring.Small 84 75 -10.7% 1.12x (?)
FloatingPointPrinting_Float_description_small 5616 5076 -9.6% 1.11x (?)
String.replaceSubrange.String.Small 66 60 -9.1% 1.10x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 91000 83500 -8.2% 1.09x (?)
ObjectiveCBridgeStringHash 136 125 -8.1% 1.09x (?)
FlattenListFlatMap 6614 6087 -8.0% 1.09x (?)
DictionaryBridgeToObjC_Access 916 845 -7.8% 1.08x (?)
Array2D 7504 6928 -7.7% 1.08x (?)
Data.hash.Empty 80 74 -7.5% 1.08x (?)
StrComplexWalk 5170 4790 -7.4% 1.08x
RandomShuffleLCG2 448 416 -7.1% 1.08x
AngryPhonebook.Cyrillic.Small 830 773 -6.9% 1.07x (?)
UTF8Decode_InitDecoding_ascii 279 260 -6.8% 1.07x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
DiffingMyers.o 6395 6330 -1.0% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
DataReplaceSmallBuffer 5300 6800 +28.3% 0.78x (?)
EqualSubstringSubstringGenericEquatable 117 145 +23.9% 0.81x
LessSubstringSubstringGenericComparable 117 145 +23.9% 0.81x
StringRemoveDupes 748 925 +23.7% 0.81x
EqualSubstringSubstring 120 148 +23.3% 0.81x
EqualSubstringString 123 151 +22.8% 0.81x
CharIndexing_japanese_unicodeScalars_Backwards 411560 502480 +22.1% 0.82x (?)
EqualStringSubstring 123 150 +22.0% 0.82x
LessSubstringSubstring 122 148 +21.3% 0.82x
CharIndexing_ascii_unicodeScalars_Backwards 337560 408200 +20.9% 0.83x (?)
CharIndexing_russian_unicodeScalars_Backwards 288000 345120 +19.8% 0.83x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 60440 72280 +19.6% 0.84x (?)
CharIndexing_tweet_unicodeScalars_Backwards 680080 810720 +19.2% 0.84x (?)
DictionaryRemove 27110 32290 +19.1% 0.84x (?)
CharIndexing_chinese_unicodeScalars_Backwards 262280 312040 +19.0% 0.84x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 77000 91520 +18.9% 0.84x (?)
DictionarySwap 6440 7604 +18.1% 0.85x (?)
CharIndexing_korean_unicodeScalars_Backwards 341840 402600 +17.8% 0.85x (?)
UTF8Decode_InitFromBytes_ascii_as_ascii 467 550 +17.8% 0.85x (?)
BitCount 50857 59606 +17.2% 0.85x (?)
StringInterpolationSmall 4600 5390 +17.2% 0.85x (?)
TwoSum 3748 4368 +16.5% 0.86x (?)
ErrorHandling 4250 4770 +12.2% 0.89x (?)
DataReplaceMedium 6400 7100 +10.9% 0.90x (?)
DataToStringSmall 5950 6600 +10.9% 0.90x (?)
Histogram 7534 8109 +7.6% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
UTF8Decode_InitFromData_ascii_as_ascii 760 660 -13.2% 1.15x (?)
Set.isStrictSuperset.Seq.Empty.Int 1624 1444 -11.1% 1.12x (?)
String.replaceSubrange.Substring.Small 90 82 -8.9% 1.10x (?)
String.replaceSubrange.String.Small 72 66 -8.3% 1.09x (?)
ObjectiveCBridgeStringHash 136 125 -8.1% 1.09x (?)
ObjectiveCBridgeStubDateMutation 1444 1345 -6.9% 1.07x (?)
UTF8Decode_InitDecoding_ascii_as_ascii 327 305 -6.7% 1.07x (?)

Code size: -swiftlibs

How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@meg-gupta
Copy link
Contributor Author

Thanks for the review @eeckstein

@meg-gupta
Copy link
Contributor Author

@swift-ci test and merge

@swift-ci swift-ci merged commit 9ef7b2a into swiftlang:main Jan 21, 2021
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.

3 participants