Skip to content

[diagnose-unreachable] Constant fold simple switch_enum_addr to elimi… #25998

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 Jul 8, 2019

…nate more unreachable code.

This patch comes out of my reading some generic code using .none in transparent
functions to conditionally compile out code at -Onone. Sadly, before this the
dead code in question wouldn't be compiled out unless the protocol was
constrained to be a class protocol.

I added a test that validates that this conditional compilation property can be
relied on in -Onone code in both cases.

…nate more unreachable code.

This patch comes out of my reading some generic code using .none in transparent
functions to conditionally compile out code at -Onone. Sadly, before this the
dead code in question wouldn't be compiled out unless the protocol was
constrained to be a class protocol.

I added a test that validates that this conditional compilation property can be
relied on in -Onone code in both cases.
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 8, 2019

@swift-ci smoke test

@airspeedswift
Copy link
Member

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Performance: -O

Regression OLD NEW DELTA RATIO
SubstringFromLongString 7 8 +14.3% 0.88x (?)
SuffixAnyCollection 12 13 +8.3% 0.92x (?)

Code size: -O

Performance: -Osize

Improvement OLD NEW DELTA RATIO
PrefixArray 14 13 -7.1% 1.08x (?)

Code size: -Osize

Performance: -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: 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 9bd600e into swiftlang:master Jul 8, 2019
@gottesmm gottesmm deleted the pr-1bdafdcbc86d37c1b2001de333ad44efcdef50db branch July 8, 2019 23:51
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