Skip to content

Commit dd371a2

Browse files
committed
rustc: Inline bitwise modification operators
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!
1 parent 2789db2 commit dd371a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_data_structures/bitslice.rs

+2
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,11 @@ pub trait BitwiseOperator {
134134

135135
pub struct Union;
136136
impl BitwiseOperator for Union {
137+
#[inline]
137138
fn join(&self, a: usize, b: usize) -> usize { a | b }
138139
}
139140
pub struct Subtract;
140141
impl BitwiseOperator for Subtract {
142+
#[inline]
141143
fn join(&self, a: usize, b: usize) -> usize { a & !b }
142144
}

0 commit comments

Comments
 (0)