about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2016-05-11 21:31:19 +0200
committerBjörn Steinbrink <bsteinbr@gmail.com>2016-05-11 22:18:46 +0200
commit49b2cdf47c983d5ea8a576346d08120f0e3af30a (patch)
tree73ae95a59ee5eb635975a2f73059eec8f3ca27fe /src/libsyntax/errors
parentc0495417416c8e0687bc6a997507c403627f6568 (diff)
downloadrust-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')
0 files changed, 0 insertions, 0 deletions