Skip to content

[semantic-arc-opts] Convert @owned -> @guaranteed args of transforming terminators when fed by load [copy], copy_value. #29605

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

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Feb 3, 2020

This extends the (copy (guaranteed x)) -> (guaranteed x) optimization to handle
transforming terminator arguments. This will eliminate a ton of ARC traffic
around optionals or casts.

I still need to add support for eliminating copies that forward through br args.
That will be in forthcoming commits after I land some changes to the ownership
model so that we can perform that optimization.

rdar://problem/56720436
rdar://problem/56720519


NOTE: Only the second commit is the actual commit for this. The first commit is from: #29600

@gottesmm gottesmm requested a review from atrick February 3, 2020 01:27
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test windows platform

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 7342 10105 +37.6% 0.73x (?)
FlattenListLoop 4265 5483 +28.6% 0.78x (?)
ObjectiveCBridgeStubFromNSDateRef 3850 4280 +11.2% 0.90x (?)
ObjectiveCBridgeFromNSStringForced 2570 2835 +10.3% 0.91x (?)
RemoveWhereMoveInts 36 39 +8.3% 0.92x
Array2D 7520 8112 +7.9% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 402 294 -26.9% 1.37x
DictionaryBridgeToObjC_Access 1100 838 -23.8% 1.31x (?)
LazilyFilteredArrayContains 34200 29500 -13.7% 1.16x
ArrayAppendLazyMap 7210 6300 -12.6% 1.14x
IterateData 1506 1402 -6.9% 1.07x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8875 8731 -1.6% 1.02x
StringComparison.o 38136 37560 -1.5% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
DataCreateSmall 2730 3000 +9.9% 0.91x (?)
Array2D 7216 7824 +8.4% 0.92x (?)
ArrayPlusEqualFiveElementCollection 7696 8325 +8.2% 0.92x (?)
RemoveWhereMoveInts 37 40 +8.1% 0.93x
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 402 232 -42.3% 1.73x (?)
DataAccessBytesMedium 103 91 -11.7% 1.13x (?)
ArrayAppendLazyMap 8130 7210 -11.3% 1.13x (?)
Data.hash.Empty 77 71 -7.8% 1.08x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8419 8227 -2.3% 1.02x
StringComparison.o 33856 33136 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 456 328 -28.1% 1.39x (?)
LazilyFilteredArrays2 134300 115000 -14.4% 1.17x (?)
LazilyFilteredArrayContains 1380800 1211900 -12.2% 1.14x (?)
ChainedFilterMap 344016 302247 -12.1% 1.14x (?)
StringUTF16SubstringBuilder 18860 17060 -9.5% 1.11x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 50200 45800 -8.8% 1.10x (?)
FatCompactMap 494840 453020 -8.5% 1.09x (?)
ArrayOfGenericPOD2 1432 1320 -7.8% 1.08x (?)
ArrayOfPOD 1119 1035 -7.5% 1.08x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftStdlibUnittest.dylib 335872 327680 -2.4% 1.02x
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

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
RemoveWhereFilterInts 24 27 +12.5% 0.89x (?)
DataCreateEmptyArray 1350 1500 +11.1% 0.90x (?)
RemoveWhereSwapInts 37 41 +10.8% 0.90x (?)
RemoveWhereMoveInts 19 21 +10.5% 0.90x (?)
RandomShuffleLCG2 464 512 +10.3% 0.91x (?)
MapReduceAnyCollection 220 241 +9.5% 0.91x (?)
ArraySetElement 283 305 +7.8% 0.93x
MapReduce 223 240 +7.6% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 250 142 -43.2% 1.76x
IterateData 967 833 -13.9% 1.16x
UTF8Decode_InitFromData_ascii 182 165 -9.3% 1.10x (?)
LazilyFilteredArrayContains 19400 17600 -9.3% 1.10x (?)
ArrayInClass 1045 955 -8.6% 1.09x (?)
DistinctClassFieldAccesses 195 179 -8.2% 1.09x (?)
UTF8Decode_InitFromBytes 143 132 -7.7% 1.08x (?)
ArrayAppendLazyMap 3880 3590 -7.5% 1.08x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8875 8731 -1.6% 1.02x
StringComparison.o 38136 37560 -1.5% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
Array2D 3744 4192 +12.0% 0.89x (?)
ArrayPlusEqualFiveElementCollection 4366 4847 +11.0% 0.90x (?)
MapReduceAnyCollection 238 260 +9.2% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 222 102 -54.1% 2.18x
DistinctClassFieldAccesses 209 180 -13.9% 1.16x (?)
StringToDataEmpty 500 450 -10.0% 1.11x (?)
Data.init.Sequence.64kB.Count.RE 55 50 -9.1% 1.10x (?)
ArrayAppendLazyMap 4520 4170 -7.7% 1.08x (?)
SubstringEqualString 244 226 -7.4% 1.08x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8419 8227 -2.3% 1.02x
StringComparison.o 33856 33136 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStubFromNSDateRef 2840 3060 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 286 162 -43.4% 1.77x
DataCopyBytesSmall 130 115 -11.5% 1.13x (?)
ExclusivityIndependent 48 44 -8.3% 1.09x (?)
ExclusivityGlobal 115 106 -7.8% 1.08x (?)
ArrayInClass 2535 2365 -6.7% 1.07x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftStdlibUnittest.dylib 335872 327680 -2.4% 1.02x
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: 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

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

I am curious if workarounds in the stdlib or the lack of the inout opt from #29480 are making this less effective on the benchmarks. I am going to finish up that other piece of work and then loop back.

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 3749 4900 +30.7% 0.77x (?)
RemoveWhereMoveInts 17 21 +23.5% 0.81x
RandomShuffleLCG2 416 512 +23.1% 0.81x
ArrayPlusEqualFiveElementCollection 4292 5254 +22.4% 0.82x
MapReduce 203 241 +18.7% 0.84x
Array2D 3744 4400 +17.5% 0.85x
RemoveWhereSwapInts 35 41 +17.1% 0.85x
ArraySetElement 262 305 +16.4% 0.86x (?)
MapReduceAnyCollection 207 238 +15.0% 0.87x
PrefixWhileAnySeqCntRange 187 215 +15.0% 0.87x (?)
DataCreateEmptyArray 1350 1550 +14.8% 0.87x (?)
DropLastSequence 298 342 +14.8% 0.87x
PrefixWhileSequence 187 214 +14.4% 0.87x (?)
PrefixWhileAnySeqCRangeIter 188 214 +13.8% 0.88x (?)
DropLastSequenceLazy 300 341 +13.7% 0.88x
RemoveWhereFilterInts 23 26 +13.0% 0.88x
ObjectiveCBridgeStubNSDateRefAccess 174 196 +12.6% 0.89x (?)
FlattenListLoop 2785 3024 +8.6% 0.92x (?)
Set.isSubset.Int.Empty 48 52 +8.3% 0.92x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
StringComparison.o 38136 37560 -1.5% 1.02x
FindStringNaive.o 8859 8731 -1.4% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 3676 4638 +26.2% 0.79x (?)
ArrayLiteral2 98 115 +17.3% 0.85x (?)
FlattenListLoop 2720 3160 +16.2% 0.86x (?)
Set.subtracting.Empty.Box 7 8 +14.3% 0.88x (?)
RemoveWhereSwapInts 31 35 +12.9% 0.89x
ArrayPlusEqualFiveElementCollection 4366 4847 +11.0% 0.90x (?)
Set.isStrictSubset.Seq.Int.Empty 108 119 +10.2% 0.91x (?)
MapReduceAnyCollection 238 259 +8.8% 0.92x (?)
ArraySetElement 262 283 +8.0% 0.93x (?)
NSStringConversion.Long 493 532 +7.9% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayAppendLazyMap 4520 4170 -7.7% 1.08x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
ArraySetElement.o 1212 1227 +1.2% 0.99x
Sim2DArray.o 1244 1259 +1.2% 0.99x
COWArrayGuaranteedParameterOverhead.o 1319 1334 +1.1% 0.99x
 
Improvement OLD NEW DELTA RATIO
StringComparison.o 33856 33136 -2.1% 1.02x
FindStringNaive.o 8403 8227 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
PopFrontArray 1580 1960 +24.1% 0.81x
Hanoi 12430 14780 +18.9% 0.84x
ArrayAppendLatin1 11016 12886 +17.0% 0.85x (?)
ArrayAppendAscii 11050 12920 +16.9% 0.86x (?)
ArrayAppendUTF16 10982 12750 +16.1% 0.86x (?)
PopFrontArrayGeneric 3080 3460 +12.3% 0.89x (?)
ArrayOfRef 6520 7140 +9.5% 0.91x
ArrayOfGenericRef 6670 7290 +9.3% 0.91x (?)
RangeReplaceableCollectionPlusDefault 4036 4352 +7.8% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayOfGenericPOD2 836 713 -14.7% 1.17x (?)
ArrayInClass 2560 2360 -7.8% 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: 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

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

Hmmm... I wonder if this is an interaction with PMO.

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

Trying eliminating the early run of semantic arc opts

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

Baring that just working, I am going to dig into the perf.

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
PrefixAnySeqCntRange 32 48 +50.0% 0.67x (?)
FlattenListLoop 3530 4150 +17.6% 0.85x (?)
Array2D 6224 7280 +17.0% 0.85x
RemoveWhereMoveInts 30 35 +16.7% 0.86x
ArrayPlusEqualFiveElementCollection 6919 8066 +16.6% 0.86x
RemoveWhereSwapInts 56 65 +16.1% 0.86x
MapReduceAnyCollection 331 382 +15.4% 0.87x
FlattenListFlatMap 5891 6797 +15.4% 0.87x (?)
MapReduceClass2 33 38 +15.2% 0.87x (?)
RandomShuffleLCG2 640 736 +15.0% 0.87x
MapReduce 334 384 +15.0% 0.87x
DropLastAnySequence 474 533 +12.4% 0.89x
ArraySetElement 411 462 +12.4% 0.89x
CharacterLiteralsLarge 87 97 +11.5% 0.90x
PrefixWhileSequence 296 330 +11.5% 0.90x
DropLastSequence 483 537 +11.2% 0.90x (?)
DropLastSequenceLazy 483 536 +11.0% 0.90x (?)
PrefixWhileAnySeqCRangeIter 295 327 +10.8% 0.90x (?)
PrefixWhileAnySeqCntRange 295 327 +10.8% 0.90x
DictionaryBridgeToObjC_Access 818 906 +10.8% 0.90x (?)
RemoveWhereFilterInts 39 43 +10.3% 0.91x
SuffixSequence 442 486 +10.0% 0.91x
SuffixSequenceLazy 442 486 +10.0% 0.91x
MapReduceSequence 534 585 +9.6% 0.91x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 38600 42000 +8.8% 0.92x (?)
ObjectiveCBridgeStubNSDateRefAccess 333 359 +7.8% 0.93x (?)
RangeAssignment 299 322 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
MapReduceNSDecimalNumber 261 105 -59.8% 2.49x
MapReduceNSDecimalNumberShort 411 253 -38.4% 1.62x
Set.isSubset.Seq.Box0 1330 1034 -22.3% 1.29x
Set.isSubset.Seq.Box25 1466 1168 -20.3% 1.26x
Set.intersection.Seq.Box0 388 326 -16.0% 1.19x
Set.intersection.Seq.Box25 507 442 -12.8% 1.15x
ArrayAppendLazyMap 6450 5630 -12.7% 1.15x
LazilyFilteredArrayContains 30300 26500 -12.5% 1.14x
ObjectiveCBridgeStubToNSDate2 1380 1240 -10.1% 1.11x (?)
StringEnumRawValueInitialization 580 540 -6.9% 1.07x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
SetTests.o 135749 142021 +4.6% 0.96x
MapReduce.o 28727 29095 +1.3% 0.99x
 
Improvement OLD NEW DELTA RATIO
StringComparison.o 38136 37560 -1.5% 1.02x
FindStringNaive.o 8859 8731 -1.4% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
NSStringConversion.MutableCopy.Rebridge.Long 795 906 +14.0% 0.88x (?)
RemoveWhereSwapInts 51 56 +9.8% 0.91x (?)
RemoveWhereMoveInts 33 36 +9.1% 0.92x
FlattenListLoop 3581 3896 +8.8% 0.92x (?)
Array2D 6480 7008 +8.1% 0.92x (?)
ArrayPlusEqualFiveElementCollection 6845 7400 +8.1% 0.93x
 
Improvement OLD NEW DELTA RATIO
ArrayAppendLazyMap 7270 6450 -11.3% 1.13x
StringToDataEmpty 700 650 -7.1% 1.08x (?)
Set.subtracting.Empty.Box 14 13 -7.1% 1.08x

Code size: -Osize

Regression OLD NEW DELTA RATIO
ArraySetElement.o 1212 1227 +1.2% 0.99x
Sim2DArray.o 1244 1259 +1.2% 0.99x
COWArrayGuaranteedParameterOverhead.o 1319 1334 +1.1% 0.99x
 
Improvement OLD NEW DELTA RATIO
StringComparison.o 33856 33136 -2.1% 1.02x
FindStringNaive.o 8403 8227 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
PopFrontArray 2680 3180 +18.7% 0.84x
Hanoi 17100 19450 +13.7% 0.88x
FloatingPointPrinting_Double_description_uniform 31700 35800 +12.9% 0.89x (?)
ArrayAppendAscii 16660 18734 +12.4% 0.89x (?)
ArrayAppendLatin1 16728 18802 +12.4% 0.89x (?)
ArrayAppendUTF16 16660 18700 +12.2% 0.89x (?)
ArrayOfGenericRef 7850 8630 +9.9% 0.91x
ArrayOfRef 7760 8510 +9.7% 0.91x (?)
FatCompactMap 372690 404960 +8.7% 0.92x (?)
PopFrontArrayGeneric 4880 5300 +8.6% 0.92x (?)

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: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 64 GB

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
PrefixAnySeqCRangeIter 36 53 +47.2% 0.68x (?)
Array2D 6944 8112 +16.8% 0.86x
RemoveWhereSwapInts 62 72 +16.1% 0.86x
RandomShuffleLCG2 704 816 +15.9% 0.86x
MapReduceAnyCollection 369 426 +15.4% 0.87x
MapReduce 372 428 +15.1% 0.87x
RemoveWhereMoveInts 34 39 +14.7% 0.87x
RemoveWhereFilterInts 43 49 +14.0% 0.88x (?)
MapReduceClass2 37 42 +13.5% 0.88x
ArraySetElement 458 515 +12.4% 0.89x
DropLastAnySequence 528 591 +11.9% 0.89x (?)
CharacterLiteralsLarge 97 108 +11.3% 0.90x
PrefixWhileAnySeqCRangeIter 329 365 +10.9% 0.90x
PrefixWhileAnySeqCntRange 329 365 +10.9% 0.90x
DropLastSequence 539 597 +10.8% 0.90x
DropLastSequenceLazy 539 596 +10.6% 0.90x
SuffixSequence 493 541 +9.7% 0.91x
SuffixSequenceLazy 493 541 +9.7% 0.91x (?)
ObjectiveCBridgeStubNSDateRefAccess 371 400 +7.8% 0.93x (?)
RangeAssignment 333 359 +7.8% 0.93x
 
Improvement OLD NEW DELTA RATIO
MapReduceNSDecimalNumber 292 117 -59.9% 2.50x
MapReduceNSDecimalNumberShort 458 281 -38.6% 1.63x
Set.isSubset.Seq.Box0 1480 1150 -22.3% 1.29x
Set.isSubset.Seq.Box25 1632 1304 -20.1% 1.25x
Set.intersection.Seq.Box0 431 364 -15.5% 1.18x
LazilyFilteredArrayContains 34400 29500 -14.2% 1.17x
ArrayAppendLazyMap 7210 6300 -12.6% 1.14x
Set.intersection.Seq.Box25 563 495 -12.1% 1.14x

Code size: -O

Regression OLD NEW DELTA RATIO
SetTests.o 135749 142021 +4.6% 0.96x
MapReduce.o 28727 29095 +1.3% 0.99x
 
Improvement OLD NEW DELTA RATIO
StringComparison.o 38136 37560 -1.5% 1.02x
FindStringNaive.o 8859 8731 -1.4% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
DictionaryBridgeToObjC_Access 900 1022 +13.6% 0.88x (?)
NSStringConversion.MutableCopy.Rebridge.Long 922 1013 +9.9% 0.91x (?)
RemoveWhereSwapInts 57 62 +8.8% 0.92x (?)
RandomShuffleLCG2 736 800 +8.7% 0.92x (?)
Array2D 7216 7824 +8.4% 0.92x (?)
ArrayPlusEqualFiveElementCollection 7696 8325 +8.2% 0.92x (?)
RemoveWhereMoveInts 37 40 +8.1% 0.93x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 42200 45600 +8.1% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayAppendLazyMap 8130 7220 -11.2% 1.13x (?)
FloatingPointPrinting_Float_description_small 5832 5400 -7.4% 1.08x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
ArraySetElement.o 1212 1227 +1.2% 0.99x
Sim2DArray.o 1244 1259 +1.2% 0.99x
COWArrayGuaranteedParameterOverhead.o 1319 1334 +1.1% 0.99x
 
Improvement OLD NEW DELTA RATIO
StringComparison.o 33856 33136 -2.1% 1.02x
FindStringNaive.o 8403 8227 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
PopFrontArray 2980 3540 +18.8% 0.84x (?)
Hanoi 19070 21710 +13.8% 0.88x
ArrayAppendAscii 18632 20944 +12.4% 0.89x (?)
ArrayAppendLatin1 18700 21012 +12.4% 0.89x (?)
ArrayAppendUTF16 18598 20876 +12.2% 0.89x (?)
StringUTF16SubstringBuilder 16880 18670 +10.6% 0.90x (?)
ArrayOfGenericRef 8750 9630 +10.1% 0.91x
ArrayOfRef 8660 9490 +9.6% 0.91x
PopFrontArrayGeneric 5440 5900 +8.5% 0.92x (?)
FatCompactMap 418640 453500 +8.3% 0.92x (?)
RomanNumbers2 10237 11029 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DictionaryBridgeToObjC_Access 1193 1065 -10.7% 1.12x (?)
DictionaryKeysContainsCocoa 48 44 -8.3% 1.09x (?)

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

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

Out of curiosity, I am going to rebase now that I landed the first patch and see if we get the same benchmark results.

@gottesmm gottesmm force-pushed the pr-db719c8315f5da4d80fcb174523fcc569fb14caf branch from f49250e to 556e506 Compare February 3, 2020 21:53
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

2 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
Set.isSuperset.Seq.Empty.Int 46 53 +15.2% 0.87x (?)
Set.subtracting.Empty.Box 7 8 +14.3% 0.88x (?)
Set.isDisjoint.Seq.Box.Empty 80 91 +13.7% 0.88x (?)
DataCreateSmallArray 2000 2200 +10.0% 0.91x (?)
Set.isSubset.Seq.Int.Empty 109 119 +9.2% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
LazilyFilteredArrayContains 18500 16700 -9.7% 1.11x (?)
ArrayAppendLazyMap 3880 3590 -7.5% 1.08x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8859 8715 -1.6% 1.02x
StringComparison.o 38136 37560 -1.5% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
Set.subtracting.Empty.Box 7 8 +14.3% 0.88x
Set.isDisjoint.Seq.Box.Empty 79 88 +11.4% 0.90x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayAppendLazyMap 4520 4170 -7.7% 1.08x (?)
ArrayInClass 915 850 -7.1% 1.08x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8403 8211 -2.3% 1.02x
StringComparison.o 33856 33136 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

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: 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

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
Set.subtracting.Empty.Box 7 8 +14.3% 0.88x (?)
Set.isDisjoint.Seq.Box.Empty 80 91 +13.7% 0.88x (?)
Set.isSuperset.Seq.Empty.Int 46 51 +10.9% 0.90x (?)
Set.isSubset.Seq.Int.Empty 109 119 +9.2% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
LazilyFilteredArrayContains 18500 16700 -9.7% 1.11x (?)
ArrayAppendLazyMap 3880 3590 -7.5% 1.08x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8859 8715 -1.6% 1.02x
StringComparison.o 38136 37560 -1.5% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
Set.subtracting.Empty.Box 7 8 +14.3% 0.88x
Set.isDisjoint.Seq.Box.Empty 78 88 +12.8% 0.89x (?)
FlattenListLoop 2821 3166 +12.2% 0.89x (?)
 
Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 4298 3508 -18.4% 1.23x (?)
UTF8Decode_InitFromBytes 141 130 -7.8% 1.08x (?)
ArrayAppendLazyMap 4520 4170 -7.7% 1.08x (?)
ArrayInClass 915 850 -7.1% 1.08x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8403 8211 -2.3% 1.02x
StringComparison.o 33856 33136 -2.1% 1.02x
RGBHistogram.o 20384 20176 -1.0% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
ArrayOfPOD 646 721 +11.6% 0.90x (?)

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: 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

@gottesmm
Copy link
Contributor Author

@swift-ci benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
ClassArrayGetter2 50 60 +20.0% 0.83x (?)
PrefixAnySeqCntRangeLazy 16 19 +18.7% 0.84x (?)
RemoveWhereSwapInts 34 40 +17.6% 0.85x (?)
NSStringConversion.Long 489 572 +17.0% 0.85x (?)
Array2D 3712 4272 +15.1% 0.87x (?)
ArrayInClass 835 960 +15.0% 0.87x (?)
ArrayPlusEqualFiveElementCollection 4329 4921 +13.7% 0.88x (?)
NSStringConversion.Medium 235 262 +11.5% 0.90x (?)
UTF8Decode_InitDecoding 108 118 +9.3% 0.92x (?)
PrefixWhileAnySeqCRangeIter 188 205 +9.0% 0.92x (?)
PrefixWhileAnySeqCntRange 188 205 +9.0% 0.92x (?)
SuffixSequence 239 260 +8.8% 0.92x (?)
SuffixSequenceLazy 235 254 +8.1% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DistinctClassFieldAccesses 202 182 -9.9% 1.11x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 9387 9203 -2.0% 1.02x
StringComparison.o 40632 40056 -1.4% 1.01x
RGBHistogram.o 21869 21581 -1.3% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
FlattenListLoop 2572 2984 +16.0% 0.86x (?)
NSStringConversion.Long 495 567 +14.5% 0.87x (?)
DistinctClassFieldAccesses 182 201 +10.4% 0.91x (?)
UTF8Decode_InitDecoding 106 117 +10.4% 0.91x (?)
Array2D 4192 4624 +10.3% 0.91x
ArrayPlusEqualFiveElementCollection 4773 5254 +10.1% 0.91x (?)
MapReduce 240 261 +8.7% 0.92x (?)
PrefixWhileSequence 192 208 +8.3% 0.92x (?)
RemoveWhereSwapInts 36 39 +8.3% 0.92x (?)
MapReduceAnyCollection 260 281 +8.1% 0.93x (?)
Set.isSubset.Seq.Int.Empty 102 110 +7.8% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 4611 3373 -26.8% 1.37x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8947 8715 -2.6% 1.03x
StringComparison.o 36696 35976 -2.0% 1.02x
RGBHistogram.o 21368 21128 -1.1% 1.01x

Performance: -Onone

Regression OLD NEW DELTA RATIO
UTF8Decode_InitDecoding 123 140 +13.8% 0.88x
DataSubscriptMedium 56 61 +8.9% 0.92x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftNetwork.dylib 159744 155648 -2.6% 1.03x
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: 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

@gottesmm
Copy link
Contributor Author

I am fixing this patch up. Interestingly I discovered that we do not eliminate (borrow (owned)) given switch_enum, checked_cast_br, when the owned value's live range completely encloses the whole borrow scope.

…g terminators when fed by load [copy], copy_value.

This extends the (copy (guaranteed x)) -> (guaranteed x) optimization to handle
transforming terminator arguments. This will begin to enable us to eliminate RC ops
around optionals or casts.

I still need to add support for eliminating copies that forward through br args and phis.

<rdar://problem/56720436>
<rdar://problem/56720519>
@gottesmm gottesmm force-pushed the pr-db719c8315f5da4d80fcb174523fcc569fb14caf branch from 556e506 to fefd027 Compare February 18, 2020 04:30
@gottesmm
Copy link
Contributor Author

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

@swift-ci test

1 similar comment
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
ArrayAppendLazyMap 5630 6450 +14.6% 0.87x
LazilyFilteredArrayContains 28000 32000 +14.3% 0.88x
RemoveWhereSwapInts 53 58 +9.4% 0.91x (?)
MapReduceClass2 35 38 +8.6% 0.92x
ArrayPlusEqualFiveElementCollection 6919 7511 +8.6% 0.92x (?)
MapReduce 333 359 +7.8% 0.93x (?)
MapReduceAnyCollection 331 356 +7.6% 0.93x (?)
FlattenListLoop 4367 4696 +7.5% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
Data.hash.Empty 66 61 -7.6% 1.08x

Code size: -O

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 9387 9203 -2.0% 1.02x
StringComparison.o 40632 40056 -1.4% 1.01x
RGBHistogram.o 21869 21581 -1.3% 1.01x

Performance: -Osize

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 4262 6397 +50.1% 0.67x (?)
FlattenListLoop 3658 4686 +28.1% 0.78x (?)
ArrayAppendLazyMap 6040 6860 +13.6% 0.88x
Array2D 6240 6752 +8.2% 0.92x (?)
ArrayPlusEqualFiveElementCollection 6956 7511 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
Data.hash.Empty 66 61 -7.6% 1.08x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
FindStringNaive.o 8947 8715 -2.6% 1.03x
StringComparison.o 36696 35976 -2.0% 1.02x
RGBHistogram.o 21368 21128 -1.1% 1.01x

Performance: -Onone

Improvement OLD NEW DELTA RATIO
CharacterPropertiesStashed 3010 2150 -28.6% 1.40x (?)
CharacterPropertiesPrecomputed 3750 2940 -21.6% 1.28x
CharacterPropertiesStashedMemo 4120 3370 -18.2% 1.22x (?)
ArrayAppendAscii 20876 17136 -17.9% 1.22x
ArrayAppendUTF16 20876 17136 -17.9% 1.22x (?)
ArrayAppendLatin1 20944 17238 -17.7% 1.21x
CharacterPropertiesFetch 5730 4840 -15.5% 1.18x (?)
CSVParsingAltIndices2 9174 8096 -11.8% 1.13x (?)
ObjectiveCBridgeStubFromNSDateRef 4230 3870 -8.5% 1.09x (?)
ArrayOfPOD 986 912 -7.5% 1.08x (?)
NSStringConversion.Mutable 3077 2874 -6.6% 1.07x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftNetwork.dylib 159744 155648 -2.6% 1.03x
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: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 64 GB

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 556e506539705ec415d7029e782def507fac6745

@gottesmm gottesmm merged commit 3526539 into swiftlang:master Feb 18, 2020
@gottesmm gottesmm deleted the pr-db719c8315f5da4d80fcb174523fcc569fb14caf branch February 18, 2020 21:37
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