Skip to content

Turn off speculative devirtualization by default. #29359

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 3 commits into from
Jan 24, 2020

Conversation

meg-gupta
Copy link
Contributor

Also, add a flag to enable the pass.

Fixes rdar://58778959 and rdar://58429282

@meg-gupta
Copy link
Contributor Author

\cc @airspeedswift

@airspeedswift
Copy link
Member

Thanks!

@airspeedswift
Copy link
Member

@swift-ci please benchmark

@airspeedswift
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
SuffixAnySeqCntRangeLazy 445 38225 +8489.9% 0.01x
SuffixAnySeqCRangeIterLazy 491 38334 +7707.3% 0.01x
DropLastAnySeqCRangeIterLazy 576 38173 +6527.2% 0.02x
DropLastAnySeqCntRangeLazy 575 37945 +6499.1% 0.02x
SuffixAnySequenceLazy 1954 4244 +117.2% 0.46x
DropLastAnySequenceLazy 2039 3821 +87.4% 0.53x
CharacterLiteralsLarge 97 108 +11.3% 0.90x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 43800 48600 +11.0% 0.90x (?)
RemoveWhereMoveInts 36 39 +8.3% 0.92x (?)
ObjectiveCBridgeStubNSDateRefAccess 371 400 +7.8% 0.93x (?)
EqualSubstringSubstring 39 42 +7.7% 0.93x
LessSubstringSubstring 39 42 +7.7% 0.93x
EqualSubstringSubstringGenericEquatable 39 42 +7.7% 0.93x
EqualSubstringString 39 42 +7.7% 0.93x (?)
LessSubstringSubstringGenericComparable 39 42 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 78 67 -14.1% 1.16x
FlattenListLoop 5321 4818 -9.5% 1.10x (?)
UTF8Decode_InitDecoding_ascii 288 263 -8.7% 1.10x (?)
NSStringConversion.MutableCopy.UTF8 883 816 -7.6% 1.08x (?)
Set.isDisjoint.Int.Empty 101 94 -6.9% 1.07x (?)
ObjectiveCBridgeStringGetASCIIContents 328 306 -6.7% 1.07x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
PolymorphicCalls.o 7525 8101 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
DropLast.o 25065 22926 -8.5% 1.09x
Suffix.o 25298 23149 -8.5% 1.09x
Combos.o 5169 4974 -3.8% 1.04x
Hash.o 22990 22282 -3.1% 1.03x
Prefix.o 19794 19211 -2.9% 1.03x
DropFirst.o 20062 19506 -2.8% 1.03x
SequenceAlgos.o 19851 19463 -2.0% 1.02x
LuhnAlgoEager.o 10544 10353 -1.8% 1.02x
LuhnAlgoLazy.o 10544 10353 -1.8% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
EqualSubstringSubstring 40 44 +10.0% 0.91x
EqualStringSubstring 40 44 +10.0% 0.91x (?)
EqualSubstringSubstringGenericEquatable 40 44 +10.0% 0.91x (?)
FlattenListFlatMap 7088 7699 +8.6% 0.92x (?)
EqualSubstringString 39 42 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 78 67 -14.1% 1.16x
ObjectiveCBridgeStringCStringUsingEncoding 575 534 -7.1% 1.08x (?)
NSStringConversion.MutableCopy.Rebridge.UTF8 742 692 -6.7% 1.07x (?)
ObjectiveCBridgeStringGetASCIIContents 328 306 -6.7% 1.07x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
ClassArrayGetter2 3940 4350 +10.4% 0.91x
 
Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 78 67 -14.1% 1.16x
Set.subtracting.Seq.Int100 8065 7376 -8.5% 1.09x (?)
DataToStringMedium 5950 5450 -8.4% 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

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3cd8f5de4fedd27ec4fb684012a702b0b1c7f049

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3cd8f5de4fedd27ec4fb684012a702b0b1c7f049

@meg-gupta
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3cd8f5de4fedd27ec4fb684012a702b0b1c7f049

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3cd8f5de4fedd27ec4fb684012a702b0b1c7f049

@meg-gupta
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f7a8a8e58ea23777947c1b21fc071071a8e8a098

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f7a8a8e58ea23777947c1b21fc071071a8e8a098

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

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 510bcd487fa627871cb9813183e32d63b87b6aa9

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 510bcd487fa627871cb9813183e32d63b87b6aa9

@meg-gupta
Copy link
Contributor Author

@swift-ci please smoke test

@meg-gupta meg-gupta merged commit 5285bf7 into swiftlang:master Jan 24, 2020
meg-gupta added a commit to meg-gupta/swift that referenced this pull request Jan 28, 2020
This is a cherrypick of swiftlang#29359

Explanation: Disable speculative devirtualization optimization. The
optimization did not give significant performance wins. Disabling it
improves code size.
Risk: Low. No significant performance hit is expected.
Issue: rdar://problem/58778959
Testing: Performance tests and regression tests
Reviewer: Erik Eckstein
airspeedswift pushed a commit that referenced this pull request Jan 29, 2020
This is a cherrypick of #29359

Explanation: Disable speculative devirtualization optimization. The
optimization did not give significant performance wins. Disabling it
improves code size.
Risk: Low. No significant performance hit is expected.
Issue: rdar://problem/58778959
Testing: Performance tests and regression tests
Reviewer: Erik Eckstein
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.

4 participants