Skip to content

Commit

Permalink
rustc: Inline bitwise modification operators
Browse files Browse the repository at this point in the history
These need to be inlined across crates to avoid showing up as one-instruction
functions in profiles! In the benchmark from #43578 this decreased the
translation item collection step from 30s to 23s, and looks like it also allowed
vectorization elsewhere of the operations!
  • Loading branch information
alexcrichton committed Aug 1, 2017
1 parent 2789db2 commit dd371a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_data_structures/bitslice.rs
Expand Up @@ -134,9 +134,11 @@ pub trait BitwiseOperator {

pub struct Union;
impl BitwiseOperator for Union {
#[inline]
fn join(&self, a: usize, b: usize) -> usize { a | b }
}
pub struct Subtract;
impl BitwiseOperator for Subtract {
#[inline]
fn join(&self, a: usize, b: usize) -> usize { a & !b }
}

0 comments on commit dd371a2

Please sign in to comment.