Skip to content

[opt] Support begin/end access instructions in store/load elimination. #31078

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

Closed
wants to merge 7 commits into from

Conversation

zoecarver
Copy link
Contributor

@zoecarver zoecarver commented Apr 16, 2020

This change has been broken into individual PRs:

  1. [LVA] Record store as read of source for reference types. #31131 Record store as read of source for reference types.
  2. [LVA] Support begin_access in projections. #31132 Support begin_access in projections.
  3. [LVA] Support access instructions in DCE. #31133 Support access instructions in DCE.
  4. [LVA] Update ignore instructions RLE and DSE. #31134 Update ignore instructions RLE and DSE.
  5. [LVA] Don't invalidate reads/writes that don't alias any tracked values. #31136 Don't invalidate reads/writes that don't alias any tracked values.
  6. [opt] Move "LastRelease" outside BB iteration. #31137 Move "LastRelease" outside BB iteration.
  7. [opt] Add dead object elimination pass after dead store elimination. #31138 Add dead object elimination pass after dead store elimination.

  • Update the projection utility to support projecting begin_access (used by both store and load elimination).
  • Update RedundantLoadElimination to skip begin/end access while processing instructions. It can figure out read/write info by processing the other instructions.
  • Update DeadStoreElimination to skip begin/end access while processing instructions for the same reason as above.

I can split this into three patches if that would be easier to review (this is one patch so I can see the benchmark results of all three together):

  1. Begin access in projection util.
  2. Begin access in RLE.
  3. Begin Access in DSE.

* Update the projection utility to support projecting begin_access (used by both store and load elim).
* Update RedundantLoadElimination to skip begin/end access while processing instructions. It can figure out read/write info by processing the other instructions (see comment for more details).
* Update DeadStoreElimination to skip begin/end access while processing instructions for the same reason as above.
  * Also don't process strong_release instructions.
@zoecarver
Copy link
Contributor Author

@swift-ci please benchmark

@zoecarver
Copy link
Contributor Author

Turns out I can't just ignore strong_release instructions :P

I've fixed the issue while (hopefully) still maintaining the performance. I've had to tweak half a dozen passes, though. I'll make sure I split those changes off into separate PRs but, as I said in the description, I want to see the combined benchmarks first.

@zoecarver
Copy link
Contributor Author

@swift-ci please benchmark

1 similar comment
@zoecarver
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
EqualStringSubstring 23 31 +34.8% 0.74x
EqualSubstringSubstring 23 30 +30.4% 0.77x
LessSubstringSubstring 23 30 +30.4% 0.77x
EqualSubstringSubstringGenericEquatable 23 30 +30.4% 0.77x
EqualSubstringString 23 30 +30.4% 0.77x
LessSubstringSubstringGenericComparable 23 30 +30.4% 0.77x
PrefixWhileArrayLazy 20 26 +30.0% 0.77x
StringComparison_longSharedPrefix 320 356 +11.2% 0.90x (?)
NSStringConversion.Long 570 617 +8.2% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixWhileAnyCollectionLazy 25 21 -16.0% 1.19x (?)
PrefixWhileAnySeqCRangeIterLazy 25 21 -16.0% 1.19x (?)
PrefixWhileAnySeqCntRangeLazy 25 21 -16.0% 1.19x
DropWhileArrayLazy 58 49 -15.5% 1.18x (?)
AngryPhonebook.Strasse 150 136 -9.3% 1.10x (?)
AngryPhonebook.Armenian 170 155 -8.8% 1.10x (?)
AngryPhonebook.Cyrillic 181 167 -7.7% 1.08x (?)
FlattenListFlatMap 5882 5446 -7.4% 1.08x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
PrimsNonStrongRef.o 121112 123256 +1.8% 0.98x
NopDeinit.o 4007 4071 +1.6% 0.98x
 
Improvement OLD NEW DELTA RATIO
Prefix.o 18608 17856 -4.0% 1.04x
PrefixWhile.o 18196 17988 -1.1% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
EqualSubstringSubstring 23 31 +34.8% 0.74x
LessSubstringSubstring 23 31 +34.8% 0.74x
EqualStringSubstring 23 31 +34.8% 0.74x
EqualSubstringSubstringGenericEquatable 23 31 +34.8% 0.74x
EqualSubstringString 23 31 +34.8% 0.74x
LessSubstringSubstringGenericComparable 23 31 +34.8% 0.74x
DropWhileAnySeqCntRange 99 124 +25.3% 0.80x
DropWhileAnySeqCRangeIter 111 138 +24.3% 0.80x
DropWhileArrayLazy 62 71 +14.5% 0.87x (?)
StringComparison_longSharedPrefix 318 359 +12.9% 0.89x
Set.subtracting.Empty.Box 8 9 +12.5% 0.89x (?)
DropFirstAnyCollection 101 112 +10.9% 0.90x (?)
SuffixAnyCollection 37 41 +10.8% 0.90x
DropLastAnyCollection 37 41 +10.8% 0.90x
DropWhileAnySeqCRangeIterLazy 150 166 +10.7% 0.90x (?)
PrefixAnySeqCRangeIterLazy 98 108 +10.2% 0.91x (?)
PrefixAnySeqCntRangeLazy 99 108 +9.1% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixArrayLazy 26 14 -46.2% 1.86x
DropWhileAnyCollectionLazy 166 126 -24.1% 1.32x
AngryPhonebook.Strasse 150 136 -9.3% 1.10x (?)
AngryPhonebook.Armenian 170 155 -8.8% 1.10x (?)
AngryPhonebook.Cyrillic 181 167 -7.7% 1.08x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
LessSubstringSubstring 27 35 +29.6% 0.77x
EqualSubstringSubstringGenericEquatable 27 34 +25.9% 0.79x (?)
LessSubstringSubstringGenericComparable 27 34 +25.9% 0.79x
EqualSubstringSubstring 28 35 +25.0% 0.80x
EqualStringSubstring 28 35 +25.0% 0.80x
EqualSubstringString 28 35 +25.0% 0.80x
 
Improvement OLD NEW DELTA RATIO
AngryPhonebook.Strasse 151 136 -9.9% 1.11x (?)
AngryPhonebook.Armenian 171 155 -9.4% 1.10x (?)
AngryPhonebook.Cyrillic 182 167 -8.2% 1.09x (?)
ObjectiveCBridgeStubToNSDateRef 2680 2480 -7.5% 1.08x (?)
StringWalk 2760 2560 -7.2% 1.08x (?)

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 mini
  Model Identifier: Macmini8,1
  Processor Name: 6-Core Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@zoecarver
Copy link
Contributor Author

It's strange to have any regressions here. I'll investigate.

DSE and RLE passes used to, in most cases, bail on all tracked locations
when they ran into an instruction that modified memory that they
couldn't identify. In most cases this memory address can be tracked to a
specific tracked location. If so, only that location has to be
invalidated.
@zoecarver
Copy link
Contributor Author

@swift-ci please benchmark

1 similar comment
@zoecarver
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
Data.append.Sequence.64kB.Count.RE.I 21 44 +109.5% 0.48x
Data.append.Sequence.64kB.Count.RE 21 44 +109.5% 0.48x
Data.append.Sequence.809B.Count.RE 67 94 +40.3% 0.71x
Data.append.Sequence.809B.Count.RE.I 66 92 +39.4% 0.72x
DataAppendSequence 6800 9400 +38.2% 0.72x
PrefixWhileArrayLazy 20 26 +30.0% 0.77x (?)
UTF8Decode_InitDecoding 140 170 +21.4% 0.82x
UTF8Decode_InitFromCustom_contiguous 141 171 +21.3% 0.82x
PrefixSequenceLazy 22 26 +18.2% 0.85x
PrefixSequence 22 26 +18.2% 0.85x
OpenClose 56 65 +16.1% 0.86x
DataSubscriptSmall 13 15 +15.4% 0.87x
RemoveWhereMoveInts 21 24 +14.3% 0.88x
DropWhileArray 21 24 +14.3% 0.88x
UTF8Decode_InitFromCustom_contiguous_ascii_as_ascii 271 302 +11.4% 0.90x (?)
UTF8Decode_InitFromCustom_noncontiguous 276 301 +9.1% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixWhileAnySequence 1107 191 -82.7% 5.80x
Set.subtracting.Seq.Int.Empty 183 110 -39.9% 1.66x
SortIntPyramid 730 450 -38.4% 1.62x
ObjectiveCBridgeStubDataAppend 4040 2720 -32.7% 1.49x
SortAdjacentIntPyramids 960 650 -32.3% 1.48x
Data.init.Sequence.64kB.Count0.I 239 169 -29.3% 1.41x
Data.init.Sequence.64kB.Count0 239 171 -28.5% 1.40x
SetSymmetricDifferenceInt100 145 105 -27.6% 1.38x
DropFirstSequence 40 29 -27.5% 1.38x
DropFirstSequenceLazy 40 29 -27.5% 1.38x
Data.append.Sequence.64kB.Count0.RE.I 241 175 -27.4% 1.38x (?)
Data.append.Sequence.64kB.Count0 234 170 -27.4% 1.38x (?)
Data.append.Sequence.64kB.Count0.I 234 170 -27.4% 1.38x
Data.init.Sequence.2047B.Count0.I 416 308 -26.0% 1.35x
Data.init.Sequence.2049B.Count0.I 416 309 -25.7% 1.35x
Data.append.Sequence.64kB.Count0.RE 242 180 -25.6% 1.34x (?)
Data.append.Sequence.809B.Count0.I 322 243 -24.5% 1.33x (?)
Data.append.Sequence.809B.Count0 321 243 -24.3% 1.32x
Data.append.Sequence.809B.Count0.RE.I 334 254 -24.0% 1.31x (?)
Data.append.Sequence.809B.Count0.RE 334 254 -24.0% 1.31x
Data.init.Sequence.64kB.Count0.RE 251 191 -23.9% 1.31x
DictionarySwap 872 668 -23.4% 1.31x
CharIteration_tweet_unicodeScalars 4840 3720 -23.1% 1.30x
CharIteration_ascii_unicodeScalars 2440 1880 -23.0% 1.30x
Data.init.Sequence.64kB.Count0.RE.I 244 189 -22.5% 1.29x (?)
Data.init.Sequence.809B.Count0.I 359 283 -21.2% 1.27x (?)
DataCountSmall 19 15 -21.1% 1.27x
DropWhileSequenceLazy 62 49 -21.0% 1.27x
Set.isStrictSubset.Seq.Box0 1136 899 -20.9% 1.26x
Set.isStrictSuperset.Seq.Box0 11337 8973 -20.9% 1.26x
Set.isStrictSuperset.Seq.Box25 1135 899 -20.8% 1.26x
Set.isSubset.Seq.Box0 1136 900 -20.8% 1.26x
Data.init.Sequence.809B.Count0 359 286 -20.3% 1.26x (?)
Data.init.Sequence.511B.Count0.I 369 294 -20.3% 1.26x (?)
Data.init.Sequence.513B.Count0.I 369 294 -20.3% 1.26x (?)
DropFirstAnySequence 2095 1694 -19.1% 1.24x
Set.isSubset.Seq.Box25 1250 1012 -19.0% 1.24x
Set.isStrictSubset.Seq.Box25 1250 1012 -19.0% 1.24x
Set.subtracting.Seq.Empty.Int 137 111 -19.0% 1.23x (?)
DictionarySwapAt 684 556 -18.7% 1.23x
DropWhileAnySequence 2122 1770 -16.6% 1.20x
PrefixWhileAnySeqCRangeIterLazy 25 21 -16.0% 1.19x (?)
PrefixWhileAnySeqCntRangeLazy 25 21 -16.0% 1.19x
Data.init.Sequence.809B.Count0.RE 362 305 -15.7% 1.19x (?)
Data.init.Sequence.809B.Count0.RE.I 362 305 -15.7% 1.19x (?)
DropWhileArrayLazy 58 49 -15.5% 1.18x
SetSymmetricDifferenceInt50 138 117 -15.2% 1.18x
Set.intersection.Seq.Box0 323 276 -14.6% 1.17x
IterateData 944 807 -14.5% 1.17x (?)
CharIteration_punctuated_unicodeScalars 560 480 -14.3% 1.17x (?)
FlattenListLoop 3218 2759 -14.3% 1.17x (?)
Set.intersection.Seq.Box25 415 357 -14.0% 1.16x (?)
FlattenListFlatMap 5143 4438 -13.7% 1.16x (?)
Prims.NonStrongRef.Unmanaged 173 151 -12.7% 1.15x (?)
Prims.NonStrongRef.Unmanaged.Closure 173 152 -12.1% 1.14x (?)
PrefixWhileAnyCollectionLazy 25 22 -12.0% 1.14x
DataCountMedium 17 15 -11.8% 1.13x (?)
SetUnionBox25 273 241 -11.7% 1.13x
Prims.NonStrongRef.UnmanagedUGR 175 155 -11.4% 1.13x (?)
Prims.NonStrongRef.UnmanagedUGR.Closure 175 155 -11.4% 1.13x (?)
WordCountUniqueASCII 1460 1300 -11.0% 1.12x
SetSymmetricDifferenceBox25 406 362 -10.8% 1.12x
ArrayPlusEqualFiveElementCollection 5254 4736 -9.9% 1.11x (?)
Prims.NonStrongRef.UnownedUnsafe.Closure 217 197 -9.2% 1.10x (?)
DistinctClassFieldAccesses 201 183 -9.0% 1.10x (?)
Prims.NonStrongRef.UnownedUnsafe 216 197 -8.8% 1.10x (?)
WordCountUniqueUTF16 1610 1470 -8.7% 1.10x (?)
SuffixSequence 301 277 -8.0% 1.09x (?)
DataSetCountSmall 63 58 -7.9% 1.09x (?)
SetExclusiveOr_OfObjects 5380 4960 -7.8% 1.08x (?)
SetSymmetricDifferenceBox0 539 497 -7.8% 1.08x (?)
CharIteration_punctuatedJapanese_unicodeScalars 560 520 -7.1% 1.08x (?)
DictionarySubscriptDefaultMutation 172 160 -7.0% 1.07x (?)
CharIteration_chinese_unicodeScalars 2320 2160 -6.9% 1.07x (?)
PrefixWhileSequence 191 178 -6.8% 1.07x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
ObjectiveCBridgingStubs.o 16741 17973 +7.4% 0.93x
PrimsNonStrongRef.o 121112 126232 +4.2% 0.96x
StringRemoveDupes.o 5573 5653 +1.4% 0.99x
NopDeinit.o 4007 4055 +1.2% 0.99x
 
Improvement OLD NEW DELTA RATIO
Prefix.o 18608 17352 -6.7% 1.07x
DropWhile.o 18386 17372 -5.5% 1.06x
PrefixWhile.o 18196 17302 -4.9% 1.05x
DropFirst.o 19948 19404 -2.7% 1.03x
ExistentialPerformance.o 50428 49324 -2.2% 1.02x
StringReplaceSubrange.o 5739 5659 -1.4% 1.01x
Combos.o 5070 5006 -1.3% 1.01x
AngryPhonebook.o 10038 9926 -1.1% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
SuffixArrayLazy 4 9 +125.0% 0.44x
CharIndexing_ascii_unicodeScalars 3520 4680 +33.0% 0.75x
Dictionary4 161 206 +28.0% 0.78x (?)
CharIndexing_chinese_unicodeScalars 3520 4480 +27.3% 0.79x
CharIndexing_tweet_unicodeScalars 7200 9160 +27.2% 0.79x
CharIndexing_japanese_unicodeScalars 5920 7480 +26.4% 0.79x
CharIndexing_punctuated_unicodeScalars 920 1160 +26.1% 0.79x (?)
CharIndexing_korean_unicodeScalars 4800 5880 +22.5% 0.82x
CharIteration_japanese_unicodeScalars 3440 4200 +22.1% 0.82x
CharIndexing_russian_unicodeScalars 4200 5080 +21.0% 0.83x
CharIndexing_punctuatedJapanese_unicodeScalars 960 1160 +20.8% 0.83x
CharIndexing_utf16_unicodeScalars 5200 6280 +20.8% 0.83x
CharIteration_ascii_unicodeScalars 2160 2600 +20.4% 0.83x
CharIteration_tweet_unicodeScalars 4280 5120 +19.6% 0.84x
CharIteration_chinese_unicodeScalars 2040 2440 +19.6% 0.84x
Dictionary4OfObjects 230 275 +19.6% 0.84x
UTF8Decode_InitDecoding 140 166 +18.6% 0.84x
CharIteration_korean_unicodeScalars 2600 3080 +18.5% 0.84x
CharIteration_punctuatedJapanese_unicodeScalars 480 560 +16.7% 0.86x (?)
UTF8Decode_InitFromCustom_contiguous 143 166 +16.1% 0.86x
CharIteration_punctuated_unicodeScalars 520 600 +15.4% 0.87x
CharIteration_russian_unicodeScalars 2480 2840 +14.5% 0.87x (?)
RemoveWhereMoveInts 21 24 +14.3% 0.88x
CharacterLiteralsLarge 65 74 +13.8% 0.88x
DropWhileAnySeqCntRange 99 111 +12.1% 0.89x (?)
Chars2 3150 3500 +11.1% 0.90x (?)
SuffixAnyCollection 37 41 +10.8% 0.90x (?)
ArrayLiteral2 100 110 +10.0% 0.91x (?)
StringComparison_ascii 348 380 +9.2% 0.92x (?)
Set.isDisjoint.Seq.Box.Empty 77 84 +9.1% 0.92x (?)
CharacterLiteralsSmall 209 226 +8.1% 0.92x
Set.isStrictSubset.Seq.Int.Empty 114 123 +7.9% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixWhileAnySequence 1301 220 -83.1% 5.91x
PrefixArrayLazy 26 13 -50.0% 2.00x
DropFirstArrayLazy 26 14 -46.2% 1.86x
Set.subtracting.Seq.Int.Empty 182 112 -38.5% 1.62x
SuffixCountableRangeLazy 6 4 -33.3% 1.50x (?)
FlattenListFlatMap 4898 3279 -33.1% 1.49x (?)
ObjectiveCBridgeStubDataAppend 4080 2940 -27.9% 1.39x
Data.append.Sequence.64kB.Count0.RE.I 241 174 -27.8% 1.39x
Data.append.Sequence.64kB.Count0.RE 241 174 -27.8% 1.39x
Data.append.Sequence.64kB.Count0 232 168 -27.6% 1.38x
Data.append.Sequence.64kB.Count0.I 231 168 -27.3% 1.37x
Data.append.Sequence.809B.Count0.I 318 240 -24.5% 1.32x
Data.init.Sequence.64kB.Count0 231 175 -24.2% 1.32x
Data.append.Sequence.809B.Count0 318 241 -24.2% 1.32x
Data.append.Sequence.809B.Count0.RE 328 250 -23.8% 1.31x
Data.init.Sequence.64kB.Count0.I 232 178 -23.3% 1.30x
Data.append.Sequence.809B.Count0.RE.I 330 254 -23.0% 1.30x
Data.init.Sequence.64kB.Count0.RE.I 239 184 -23.0% 1.30x
Data.init.Sequence.64kB.Count0.RE 239 185 -22.6% 1.29x (?)
DictionarySwap 868 672 -22.6% 1.29x
Data.init.Sequence.2047B.Count0.I 409 322 -21.3% 1.27x
Set.isStrictSuperset.Seq.Box0 11520 9111 -20.9% 1.26x
Set.isStrictSuperset.Seq.Box25 1153 913 -20.8% 1.26x
Set.isStrictSubset.Seq.Box0 1153 913 -20.8% 1.26x
Set.isSubset.Seq.Box0 1153 913 -20.8% 1.26x
Data.init.Sequence.2049B.Count0.I 410 326 -20.5% 1.26x
Data.init.Sequence.809B.Count0 356 288 -19.1% 1.24x
Data.init.Sequence.809B.Count0.I 356 288 -19.1% 1.24x
Set.isStrictSubset.Seq.Box25 1269 1029 -18.9% 1.23x
Set.isSubset.Seq.Box25 1270 1030 -18.9% 1.23x
DictionarySwapAt 684 556 -18.7% 1.23x
Data.init.Sequence.513B.Count0.I 369 300 -18.7% 1.23x
Data.init.Sequence.809B.Count0.RE 359 292 -18.7% 1.23x (?)
Data.init.Sequence.809B.Count0.RE.I 358 292 -18.4% 1.23x (?)
Data.init.Sequence.511B.Count0.I 368 303 -17.7% 1.21x
Set.subtracting.Seq.Empty.Int 137 113 -17.5% 1.21x (?)
CharIteration_russian_unicodeScalars_Backwards 4120 3520 -14.6% 1.17x
Set.intersection.Seq.Box0 330 283 -14.2% 1.17x
Set.intersection.Seq.Box25 425 365 -14.1% 1.16x
StringRemoveDupes 264 228 -13.6% 1.16x
NibbleSort 2510 2190 -12.7% 1.15x (?)
SetSymmetricDifferenceBox25 414 367 -11.4% 1.13x
SetUnionBox25 276 247 -10.5% 1.12x
WordCountUniqueASCII 1460 1310 -10.3% 1.11x (?)
SetUnion_OfObjects 4250 3860 -9.2% 1.10x (?)
SetUnionBox0 425 386 -9.2% 1.10x (?)
PrefixWhileAnyCollection 153 139 -9.2% 1.10x (?)
SetExclusiveOr_OfObjects 5460 5010 -8.2% 1.09x (?)
Walsh 631 579 -8.2% 1.09x (?)
WordCountUniqueUTF16 1610 1480 -8.1% 1.09x (?)
SetSymmetricDifferenceBox0 546 502 -8.1% 1.09x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
StringRemoveDupes.o 3895 4811 +23.5% 0.81x
 
Improvement OLD NEW DELTA RATIO
PrefixWhile.o 16540 16156 -2.3% 1.02x
DropWhile.o 17940 17552 -2.2% 1.02x
Suffix.o 22227 21979 -1.1% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
UTF8Decode_InitDecoding 150 178 +18.7% 0.84x
UTF8Decode_InitFromCustom_contiguous 154 180 +16.9% 0.86x
UTF8Decode_InitFromData_ascii 181 202 +11.6% 0.90x (?)
ArrayAppendAsciiSubstring 31716 34344 +8.3% 0.92x (?)
ArrayAppendLatin1Substring 32220 34884 +8.3% 0.92x (?)
ArrayAppendUTF16Substring 31788 34344 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
SetUnionInt100 276 147 -46.7% 1.88x
SetUnionInt50 388 231 -40.5% 1.68x
SetUnionInt25 424 261 -38.4% 1.62x
SetSubtractingInt100 374 257 -31.3% 1.46x
SetUnion 6400 4590 -28.3% 1.39x
SetUnionInt0 648 465 -28.2% 1.39x
Set.filter.Int100.24k 3067 2205 -28.1% 1.39x
ObjectiveCBridgeStubDataAppend 4380 3160 -27.9% 1.39x
Set.filter.Int100.20k 2597 1879 -27.6% 1.38x
SetSubtractingInt25 265 192 -27.5% 1.38x
SetSubtractingInt50 306 223 -27.1% 1.37x
Set.filter.Int100.16k 2199 1604 -27.1% 1.37x
SetSubtractingInt0 205 150 -26.8% 1.37x
Set.filter.Int100.28k 4009 2947 -26.5% 1.36x
Set.isDisjoint.Int0 933 691 -25.9% 1.35x
Set.filter.Int50.24k 1843 1408 -23.6% 1.31x
Set.filter.Int50.20k 1562 1202 -23.0% 1.30x
Set.filter.Int50.16k 1304 1011 -22.5% 1.29x
Set.filter.Int50.28k 2356 1845 -21.7% 1.28x
SetSymmetricDifferenceInt25 564 446 -20.9% 1.26x
SetUnionBox25 1027 815 -20.6% 1.26x
SetSymmetricDifferenceInt50 546 435 -20.3% 1.26x
SetIntersectionInt100 638 509 -20.2% 1.25x
SetSubtractingBox25 637 509 -20.1% 1.25x
SetSymmetricDifferenceInt100 519 416 -19.8% 1.25x
SetExclusiveOr 7990 6670 -16.5% 1.20x
SetUnion_OfObjects 18090 15270 -15.6% 1.18x
SetSymmetricDifferenceInt0 799 675 -15.5% 1.18x
Set.intersection.Seq.Int100 1728 1461 -15.5% 1.18x
Dict.CopyKeyValue.24k 4033 3412 -15.4% 1.18x
Dict.CopyKeyValue.20k 3427 2908 -15.1% 1.18x
SetIntersectionInt50 397 337 -15.1% 1.18x
Dict.CopyKeyValue.16k 2866 2448 -14.6% 1.17x
Set.isDisjoint.Int25 867 742 -14.4% 1.17x
Dict.CopyKeyValue.28k 5225 4487 -14.1% 1.16x (?)
SetUnionBox0 1775 1527 -14.0% 1.16x
Set.isDisjoint.Box0 2100 1810 -13.8% 1.16x
SetSubtractingBox0 445 384 -13.7% 1.16x
Set.isDisjoint.Int50 848 735 -13.3% 1.15x (?)
Set.intersection.Seq.Int50 1480 1283 -13.3% 1.15x
Set.isStrictSubset.Seq.Int25 5585 4858 -13.0% 1.15x (?)
Set.intersection.Seq.Int25 1367 1193 -12.7% 1.15x (?)
Set.isStrictSuperset.Seq.Int25 5422 4742 -12.5% 1.14x (?)
SetSymmetricDifferenceBox25 1404 1228 -12.5% 1.14x
Set.isStrictSubset.Seq.Int50 5717 5021 -12.2% 1.14x (?)
SetIntersectionInt25 279 246 -11.8% 1.13x (?)
Set.isSubset.Seq.Int50 5678 5015 -11.7% 1.13x (?)
Set.intersection.Seq.Int0 1220 1078 -11.6% 1.13x
Set.isSubset.Seq.Int25 5537 4901 -11.5% 1.13x (?)
Set.isStrictSuperset.Seq.Int50 5382 4764 -11.5% 1.13x (?)
Set.isStrictSubset.Seq.Int0 5388 4771 -11.5% 1.13x
DictionarySwapAt 2892 2572 -11.1% 1.12x (?)
WordCountUniqueASCII 8280 7370 -11.0% 1.12x (?)
Set.isSubset.Seq.Int0 5380 4794 -10.9% 1.12x (?)
WordCountUniqueUTF16 8470 7580 -10.5% 1.12x (?)
Set.isStrictSuperset.Seq.Int0 53445 47858 -10.5% 1.12x (?)
Set.isSubset.Seq.Int100 5994 5398 -9.9% 1.11x (?)
Set.isStrictSubset.Seq.Int100 6419 5840 -9.0% 1.10x
Set.isStrictSuperset.Seq.Int100 6399 5827 -8.9% 1.10x (?)
Set.isDisjoint.Int100 630 579 -8.1% 1.09x
Set.isDisjoint.Box25 1686 1552 -7.9% 1.09x (?)
Set.isStrictSuperset.Seq.Box0 68060 62688 -7.9% 1.09x (?)
Set.isSubset.Seq.Box25 7355 6784 -7.8% 1.08x (?)
Set.isStrictSuperset.Seq.Box25 6907 6384 -7.6% 1.08x (?)
Set.isSubset.Seq.Box0 6869 6351 -7.5% 1.08x (?)
TwoSum 2446 2270 -7.2% 1.08x (?)

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 mini
  Model Identifier: Macmini8,1
  Processor Name: 6-Core Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

// If this is a reference type, then the *live* store counts as an unkown
// read.
if (L.getBase()->getType().isAnyClassReferenceType())
S->stopTrackingLocation(S->BBWriteSetMid, i);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was always an issue. We just never ran into it because before this patch we struggled with reference types.

@zoecarver
Copy link
Contributor Author

Yes! That's the kind of benchmark result I was looking for. @eeckstein thank you for the suggestion about how to solve the alloc_ref problem. This was definitely the right path.

The regressions look either not-serious or easy edge cases to fix.

@zoecarver
Copy link
Contributor Author

Now that I've got the benchmarks I'm going to close this PR and open separate PRs for all of the changes here.

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