Skip to content

CSE/OSSA avoid endless cloning and reoptimization #39736

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 2 commits into from
Oct 14, 2021

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Oct 14, 2021

Prevent CSE from introducing useless copies, borrows, and
clones. Otherwise it will endlessly clone and re-cse the same
projections endlessly.

TODO: Most of these cases can be handled GuarateedOwnershipExtension
or extendOwnedLifetime without requiring any copies!

The client needs to be able to check if any instructions may be cloned
to produce valid OSSA during RAUW.
Prevent CSE from introducing useless copies, borrows, and
clones. Otherwise it will endlessly clone and re-cse the same
projections endlessly.

TODO: Most of these cases can be handled GuarateedOwnershipExtension
or extendOwnedLifetime without requiring any copies!
@atrick
Copy link
Contributor Author

atrick commented Oct 14, 2021

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Oct 14, 2021

@swift-ci benchmark

@meg-gupta
Copy link
Contributor

thanks!

@swift-ci
Copy link
Contributor

Performance (x86_64): -O

Regression OLD NEW DELTA RATIO
ArrayAppendOptionals 610 1040 +70.5% 0.59x (?)
StringBuilder 189 210 +11.1% 0.90x (?)
StringUTF16Builder 200 220 +10.0% 0.91x (?)
StringBuilderSmallReservingCapacity 201 218 +8.5% 0.92x (?)

Code size: -O

Performance (x86_64): -Osize

Regression OLD NEW DELTA RATIO
StringBuilder 190 216 +13.7% 0.88x (?)
StringBuilderSmallReservingCapacity 199 225 +13.1% 0.88x (?)
 
Improvement OLD NEW DELTA RATIO
FlattenListLoop 1571 1320 -16.0% 1.19x (?)

Code size: -Osize

Performance (x86_64): -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: 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

@atrick atrick merged commit 003bd5a into swiftlang:main Oct 14, 2021
@atrick atrick deleted the cse-clonecheck branch October 14, 2021 18:31
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