]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #36993 - nnethercote:obligation, r=nikomatsakis
authorbors <bors@rust-lang.org>
Thu, 3 Nov 2016 00:46:44 +0000 (17:46 -0700)
committerGitHub <noreply@github.com>
Thu, 3 Nov 2016 00:46:44 +0000 (17:46 -0700)
Optimize ObligationForest's NodeState handling.

This commit does the following.
- Changes `NodeState` from an enum to a `bitflags`. This makes it
  possible to check against multiple possible values in a single bitwise
  operation.
- Replaces all the hot `match`es involving `NodeState` with `if`/`else`
  chains that ensure that cases are handled in the order of frequency.
- Partially inlines two functions, `find_cycles_from_node` and
  `mark_as_waiting_from`, at two call sites in order to avoid function
  unnecessary function calls on hot paths.
- Fully inlines and removes `is_popped`.

These changes speeds up rustc-benchmarks/inflate-0.1.0 by about 7% when
doing debug builds with a stage1 compiler.

r? @arielb1


Trivial merge