diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2016-05-11 21:31:19 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2016-05-11 22:18:46 +0200 |
| commit | 49b2cdf47c983d5ea8a576346d08120f0e3af30a (patch) | |
| tree | 73ae95a59ee5eb635975a2f73059eec8f3ca27fe /src/libsyntax/errors/json.rs | |
| parent | c0495417416c8e0687bc6a997507c403627f6568 (diff) | |
| download | rust-49b2cdf47c983d5ea8a576346d08120f0e3af30a.tar.gz rust-49b2cdf47c983d5ea8a576346d08120f0e3af30a.zip | |
[MIR trans] Optimize trans for biased switches
Currently, all switches in MIR are exhausitive, meaning that we can have a lot of arms that all go to the same basic block, the extreme case being an if-let expression which results in just 2 possible cases, be might end up with hundreds of arms for large enums. To improve this situation and give LLVM less code to chew on, we can detect whether there's a pre-dominant target basic block in a switch and then promote this to be the default target, not translating the corresponding arms at all. In combination with #33544 this makes unoptimized MIR trans of nickel.rs as fast as using old trans and greatly improves the times for optimized builds, which are only 30-40% slower instead of ~300%. cc #33111
Diffstat (limited to 'src/libsyntax/errors/json.rs')
0 files changed, 0 insertions, 0 deletions
