Skip to content

[temp-rvalue] Teach how to optimize unchecked_take_enum_data_addr of an Optional type. #30293

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 Mar 9, 2020

unchecked_take_enum_data_addr only writes to memory in certain cases. Optional
is not one of those cases luckily.

Given that I am adding support here just for optionals so that we can get rid of
temporaries that are used with a switch_enum_addr. This is an example of a case
where we need to eliminate temporary allocations to allow for Semantic ARC Opts
to eliminate further traffic.

…an Optional type.

unchecked_take_enum_data_addr only writes to memory in certain cases. Optional
is not one of those cases luckily.

Given that I am adding support here just for optionals so that we can get rid of
temporaries that are used with a switch_enum_addr. This is an example of a case
where we need to eliminate temporary allocations to allow for Semantic ARC Opts
to eliminate further traffic.
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 9, 2020

Just slicing off small improvements.

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 9, 2020

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 9, 2020

@swift-ci smoke test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 9, 2020

Performance: -O

Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 5628 4027 -28.4% 1.40x (?)
FlattenListLoop 3178 2676 -15.8% 1.19x (?)

Code size: -O

Performance: -Osize

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
StringInterpolationManySmallSegments 10300 12800 +24.3% 0.80x (?)

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 gottesmm merged commit 11df7a8 into swiftlang:master Mar 9, 2020
@gottesmm gottesmm deleted the pr-55fe1cfe477ee888a3b18c3923c34ce370d6fea8 branch March 9, 2020 05:18
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