Skip to content

SimplifyCFG: Handle checked_cast_addr_br with consumption kind copy_on_success #33839

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
Sep 8, 2020

Conversation

eeckstein
Copy link
Contributor

We didn't optimize such casts with copy_on_success, which could result in very stupid code, e.g. for type identity casts (which should be a no-op).

@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

@eeckstein eeckstein requested a review from gottesmm September 7, 2020 15:55
@swift-ci
Copy link
Contributor

swift-ci commented Sep 7, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
UTF8Decode_InitDecoding 144 169 +17.4% 0.85x
UTF8Decode_InitFromCustom_contiguous 142 166 +16.9% 0.86x
UTF8Decode_InitFromCustom_noncontiguous 293 321 +9.6% 0.91x (?)
StringHashing_latin1 216 234 +8.3% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
ConvertFloatingPoint.GenericDoubleToDouble 60 16 -73.3% 3.75x
FlattenListLoop 1548 988 -36.2% 1.57x (?)
EqualSubstringSubstring 29 22 -24.1% 1.32x
LessSubstringSubstring 29 22 -24.1% 1.32x
EqualSubstringSubstringGenericEquatable 29 22 -24.1% 1.32x
EqualSubstringString 29 22 -24.1% 1.32x
LessSubstringSubstringGenericComparable 29 22 -24.1% 1.32x
EqualStringSubstring 29 23 -20.7% 1.26x (?)
FlattenListFlatMap 4002 3368 -15.8% 1.19x (?)
StringComparison_longSharedPrefix 377 341 -9.5% 1.11x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
StringFromLongWholeSubstring 2 3 +50.0% 0.67x
UTF8Decode_InitFromCustom_contiguous 142 166 +16.9% 0.86x
UTF8Decode_InitDecoding 144 166 +15.3% 0.87x
UTF8Decode_InitFromCustom_noncontiguous 262 286 +9.2% 0.92x (?)
ArrayAppendAsciiSubstring 32580 35388 +8.6% 0.92x (?)
StringHashing_latin1 216 234 +8.3% 0.92x (?)
StringHashing_fastPrenormal 620 670 +8.1% 0.93x (?)
StringWalk 1520 1640 +7.9% 0.93x (?)
ArrayAppendUTF16Substring 32580 35136 +7.8% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ConvertFloatingPoint.GenericDoubleToDouble 59 14 -76.3% 4.21x
EqualSubstringSubstring 29 22 -24.1% 1.32x
LessSubstringSubstring 29 22 -24.1% 1.32x
EqualStringSubstring 29 22 -24.1% 1.32x
EqualSubstringSubstringGenericEquatable 29 22 -24.1% 1.32x
EqualSubstringString 29 22 -24.1% 1.32x (?)
LessSubstringSubstringGenericComparable 29 22 -24.1% 1.32x
ArrayPlusEqualSingleElementCollection 470 423 -10.0% 1.11x (?)
StringComparison_longSharedPrefix 378 342 -9.5% 1.11x (?)
Data.hash.Medium 33 30 -9.1% 1.10x (?)
FlattenListFlatMap 3417 3127 -8.5% 1.09x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
UTF8Decode_InitFromCustom_contiguous 152 175 +15.1% 0.87x
UTF8Decode_InitDecoding 152 175 +15.1% 0.87x
ArrayOfPOD 650 723 +11.2% 0.90x (?)
ArrayOfGenericPOD2 556 610 +9.7% 0.91x (?)
 
Improvement OLD NEW DELTA RATIO
LessSubstringSubstringGenericComparable 33 26 -21.2% 1.27x
EqualSubstringSubstring 34 27 -20.6% 1.26x
LessSubstringSubstring 34 27 -20.6% 1.26x
EqualStringSubstring 34 27 -20.6% 1.26x (?)
EqualSubstringSubstringGenericEquatable 33 27 -18.2% 1.22x
EqualSubstringString 34 28 -17.6% 1.21x
StringWalk 3200 2920 -8.7% 1.10x (?)

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

@swift-ci
Copy link
Contributor

swift-ci commented Sep 7, 2020

Build failed
Swift Test Linux Platform
Git Sha - 1a91e25be1aab79e4b347bb0023fa0442e5541e3

@swift-ci
Copy link
Contributor

swift-ci commented Sep 7, 2020

Build failed
Swift Test OS X Platform
Git Sha - 1a91e25be1aab79e4b347bb0023fa0442e5541e3

…n_success

We didn't optimize such casts with copy_on_success, which could result in very stupid code, e.g. for type identity casts (which should be a no-op).
@eeckstein eeckstein force-pushed the improve-cast-optimizer branch from 1a91e25 to 0ec6eb2 Compare September 8, 2020 07:38
@eeckstein
Copy link
Contributor Author

@swift-ci test

1 similar comment
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit d84bab0 into swiftlang:master Sep 8, 2020
@eeckstein eeckstein deleted the improve-cast-optimizer branch September 8, 2020 11:54
Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Looks good to me! Also I really appreciate that you added both trivial/non-trivial tests!

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