Skip to content
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

Introduce a SwitchInt construct to MIR #29588

Merged
merged 2 commits into from
Nov 6, 2015
Merged

Conversation

nikomatsakis
Copy link
Contributor

Introduce a SwitchInt and restructure pattern matching to collect integers and characters into one master switch. This is aimed at #29227, but is not a complete fix. Whereas before we generated an if-else-if chain and, at least on my machine, just failed to compile, we now spend ~9sec compiling rustc_abuse. AFAICT this is basically just due to a need for more micro-optimization of the matching process: perf shows a fair amount of time just spent iterating over the candidate list. Still, it seemed worth opening a PR with this step alone, since it's a big step forward.

integers and characters into one master switch.
@rust-highfive
Copy link
Collaborator

r? @Aatch

(rust_highfive has picked a reviewer for you, use r? to override)

@Aatch
Copy link
Contributor

Aatch commented Nov 5, 2015

Looks good to me. Matches the design for LLVM's switch pretty well, so should be easy to translate when we get there.

@Aatch
Copy link
Contributor

Aatch commented Nov 5, 2015

@bors r+ 3e6b454

@bors
Copy link
Contributor

bors commented Nov 5, 2015

⌛ Testing commit 3e6b454 with merge 81f13bc...

@bors
Copy link
Contributor

bors commented Nov 5, 2015

💔 Test failed - auto-mac-64-nopt-t

@nikomatsakis
Copy link
Contributor Author

@bors r=aatch

@bors
Copy link
Contributor

bors commented Nov 5, 2015

📌 Commit dcf323e has been approved by aatch

@bors
Copy link
Contributor

bors commented Nov 6, 2015

⌛ Testing commit dcf323e with merge 98fa2ac...

bors added a commit that referenced this pull request Nov 6, 2015
Introduce a `SwitchInt` and restructure pattern matching to collect integers and characters into one master switch. This is aimed at #29227, but is not a complete fix. Whereas before we generated an if-else-if chain and, at least on my machine, just failed to compile, we now spend ~9sec compiling `rustc_abuse`. AFAICT this is basically just due to a need for more micro-optimization of the matching process: perf shows a fair amount of time just spent iterating over the candidate list. Still, it seemed worth opening a PR with this step alone, since it's a big step forward.
@bors bors merged commit dcf323e into rust-lang:master Nov 6, 2015
@nikomatsakis nikomatsakis deleted the mir-switch branch March 30, 2016 16:16
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.

4 participants