rust-lang/rust — pull request #17317 by thestinger (2014-09-16 20:12:09+00:00)
Title: expose expect intrinsics + mark push slow path

This marks the slow path in the `Vec` `push` function, improviding
code generation by moving it out of fast paths. The `push` function is
inlined in countless locations and not all of them order these blocks
appropriately without a hint. This improves the performance of the
microbenchmark in #15177 by 15% when dirty page purging is disabled.

Exposing the i1 version of the intrinsic for `bool` would be useful, but
the quirks of Rust's code generation prevent it from becoming branch
metadata so it has been left out for now.

A more sophisticated approach could be taken in the future (#11092) but
this provides a useful optimization feature today.