Skip to content

Improve OSSA rauw capability and add unit tests #39805

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
Oct 19, 2021

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Oct 18, 2021

Make Ownership RAUW checks more precise - allows more optimization.
Allow RAUW to optimize struct_extract from function args
Add new CSE unit tests for OSSA optimization

CSE currently seems to be the easiest place to add tests for the RAUW utility.

Call findOwnershipReferenceRoot when checking for guaranteed values
from SILFunctionArgument.

TODO: We need to add a component path to a reference root abstraction
to handle references that come from a struct_extract or tuple_extract.
@atrick
Copy link
Contributor Author

atrick commented Oct 18, 2021

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Oct 18, 2021

The passes SCK testing locally with OME running before Mem2Reg

@atrick
Copy link
Contributor Author

atrick commented Oct 18, 2021

@swift-ci benchmark

@swift-ci
Copy link
Contributor

Performance (x86_64): -O

Regression OLD NEW DELTA RATIO
StringFromLongWholeSubstring 4 5 +25.0% 0.80x
LessSubstringSubstring 39 43 +10.3% 0.91x (?)
DictionaryKeysContainsCocoa 33 36 +9.1% 0.92x (?)
String.replaceSubrange.ArrChar.Small 69 75 +8.7% 0.92x (?)
EqualSubstringSubstring 39 42 +7.7% 0.93x (?)
EqualStringSubstring 39 42 +7.7% 0.93x (?)
EqualSubstringString 39 42 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
Breadcrumbs.MutatedUTF16ToIdx.Mixed 309 274 -11.3% 1.13x (?)
Breadcrumbs.MutatedIdxToUTF16.Mixed 313 279 -10.9% 1.12x (?)
StringBuilder 331 307 -7.3% 1.08x (?)
ConvertFloatingPoint.MockFloat64Exactly2 28 26 -7.1% 1.08x (?)

Code size: -O

Performance (x86_64): -Osize

Regression OLD NEW DELTA RATIO
LessSubstringSubstring 40 44 +10.0% 0.91x
EqualSubstringSubstringGenericEquatable 40 44 +10.0% 0.91x (?)
DictionaryKeysContainsCocoa 31 34 +9.7% 0.91x (?)
String.replaceSubrange.ArrChar.Small 69 75 +8.7% 0.92x
 
Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 6174 5674 -8.1% 1.09x (?)

Code size: -Osize

Performance (x86_64): -Onone

Improvement OLD NEW DELTA RATIO
UTF8Decode_InitFromBytes_ascii 359 299 -16.7% 1.20x (?)

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

@atrick atrick merged commit df26a6d into swiftlang:main Oct 19, 2021
@atrick atrick deleted the oou-opt-rauw branch October 19, 2021 16:31
kubamracek added a commit to kubamracek/swift that referenced this pull request Oct 22, 2021
atrick added a commit that referenced this pull request Oct 23, 2021
…883489ced31ceb700674

Revert "Merge pull request #39805 from atrick/oou-opt-rauw"
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