diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-07-31 18:39:25 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-07-31 18:39:25 -0700 |
| commit | dd371a2069e84bf58702cb4c760681ee9c8aa874 (patch) | |
| tree | 67e79628c7009998b2f7f6c66a299955a33e4bf3 /src/librustc_data_structures/bitslice.rs | |
| parent | 2789db2720109ade328c87f3502dae7356bd825e (diff) | |
| download | rust-dd371a2069e84bf58702cb4c760681ee9c8aa874.tar.gz rust-dd371a2069e84bf58702cb4c760681ee9c8aa874.zip | |
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!
Diffstat (limited to 'src/librustc_data_structures/bitslice.rs')
| -rw-r--r-- | src/librustc_data_structures/bitslice.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_data_structures/bitslice.rs b/src/librustc_data_structures/bitslice.rs index ba53578e579..f74af6ee163 100644 --- a/src/librustc_data_structures/bitslice.rs +++ b/src/librustc_data_structures/bitslice.rs @@ -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 } } |
