Skip to content

Commit 904079c

Browse files
authored
chore: clean up #[inline] annotations (#7000)
Remove #[inline] from private, pub(crate), and inner functions where the compiler already has full visibility, and from large (>20 line) functions where code bloat outweighs benefit. Add #[inline] to BitBuffer operator trait impls (BitOr, BitAnd, Not, BitXor) — non-generic impls on a concrete type that are otherwise opaque cross-crate with LTO disabled. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
1 parent 002f49e commit 904079c

30 files changed

Lines changed: 11 additions & 42 deletions

File tree

encodings/fastlanes/src/bit_transpose/aarch64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ static SCATTER_8X8_NEON: [[u8; 16]; 4] = [
114114

115115
/// Perform 8x8 bit transpose on two u64s packed in a `uint64x2_t`.
116116
#[allow(unsafe_op_in_unsafe_fn)]
117-
#[inline]
118117
unsafe fn bit_transpose_8x8_neon(mut v: uint64x2_t) -> uint64x2_t {
119118
let mask1 = vdupq_n_u64(TRANSPOSE_2X2);
120119
let t = vandq_u64(veorq_u64(v, vshrq_n_u64::<7>(v)), mask1);

encodings/fastlanes/src/bit_transpose/scalar.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use crate::bit_transpose::TRANSPOSE_8X8;
1515
#[allow(dead_code)]
1616
pub fn transpose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
1717
// Helper to perform 8x8 bit transpose on a u64 (each byte becomes a row)
18-
#[inline]
1918
fn transpose_8x8(mut x: u64) -> u64 {
2019
// Step 1: Transpose 2x2 bit blocks
2120
let t = (x ^ (x >> 7)) & TRANSPOSE_2X2;
@@ -29,7 +28,6 @@ pub fn transpose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
2928
}
3029

3130
// Helper to gather 8 bytes at stride 16 into a u64
32-
#[inline]
3331
fn gather(input: &[u8; 128], base: usize) -> u64 {
3432
u64::from(input[base])
3533
| (u64::from(input[base + 16]) << 8)
@@ -89,7 +87,6 @@ pub fn transpose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
8987
#[inline(never)]
9088
#[allow(dead_code)]
9189
pub fn untranspose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
92-
#[inline]
9390
fn transpose_8x8(mut x: u64) -> u64 {
9491
let t = (x ^ (x >> 7)) & TRANSPOSE_2X2;
9592
x = x ^ t ^ (t << 7);
@@ -99,7 +96,6 @@ pub fn untranspose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
9996
x ^ t ^ (t << 28)
10097
}
10198

102-
#[inline]
10399
fn gather_transposed(input: &[u8; 128], base_group: usize, offset: usize) -> u64 {
104100
let mut result: u64 = 0;
105101
for bit_pos in 0..8 {
@@ -108,7 +104,6 @@ pub fn untranspose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
108104
result
109105
}
110106

111-
#[inline]
112107
fn scatter(output: &mut [u8; 128], base: usize, val: u64) {
113108
output[base] = val as u8;
114109
output[base + 16] = (val >> 8) as u8;

encodings/fastlanes/src/bit_transpose/x86.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub fn has_vbmi() -> bool {
4949
#[allow(unsafe_op_in_unsafe_fn)]
5050
pub unsafe fn transpose_bits_bmi2(input: &[u8; 128], output: &mut [u8; 128]) {
5151
// Helper to gather 8 bytes at stride 16 into a u64
52-
#[inline]
5352
fn gather(input: &[u8; 128], base: usize) -> u64 {
5453
(input[base] as u64)
5554
| ((input[base + 16] as u64) << 8)
@@ -238,7 +237,6 @@ pub unsafe fn transpose_bits_bmi2(input: &[u8; 128], output: &mut [u8; 128]) {
238237
#[allow(unsafe_op_in_unsafe_fn)]
239238
pub unsafe fn untranspose_bits_bmi2(input: &[u8; 128], output: &mut [u8; 128]) {
240239
// Helper: scatter a u64 to 8 output bytes at stride 16
241-
#[inline]
242240
fn scatter(output: &mut [u8; 128], base: usize, val: u64) {
243241
output[base] = val as u8;
244242
output[base + 16] = (val >> 8) as u8;

encodings/fastlanes/src/bitpacking/array/unpack_iter.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,10 @@ impl<T: PhysicalPType, S: UnpackStrategy<T>> UnpackedChunks<T, S> {
256256
})
257257
}
258258

259-
#[inline]
260259
fn last_chunk_is_sliced(&self) -> bool {
261260
self.last_chunk_length != 0
262261
}
263262

264-
#[inline]
265263
fn first_chunk_is_sliced(&self) -> bool {
266264
self.offset != 0
267265
}

encodings/fastlanes/src/delta/array/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ impl DeltaArray {
161161
&self.deltas
162162
}
163163

164-
#[inline]
165164
pub(crate) fn lanes(&self) -> usize {
166165
let ptype =
167166
PType::try_from(self.dtype()).vortex_expect("DeltaArray DType must be primitive");
@@ -189,17 +188,14 @@ impl DeltaArray {
189188
self.offset
190189
}
191190

192-
#[inline]
193191
pub(crate) fn bases_len(&self) -> usize {
194192
self.bases.len()
195193
}
196194

197-
#[inline]
198195
pub(crate) fn deltas_len(&self) -> usize {
199196
self.deltas.len()
200197
}
201198

202-
#[inline]
203199
pub(crate) fn stats_set(&self) -> &ArrayStats {
204200
&self.stats_set
205201
}

encodings/fastlanes/src/for/array/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ impl FoRArray {
6363
&self.reference
6464
}
6565

66-
#[inline]
6766
pub(crate) fn stats_set(&self) -> &ArrayStats {
6867
&self.stats_set
6968
}

encodings/fastlanes/src/rle/array/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ impl RLEArray {
207207
self.offset
208208
}
209209

210-
#[inline]
211210
pub(crate) fn stats_set(&self) -> &ArrayStats {
212211
&self.stats_set
213212
}

encodings/runend/src/iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::cmp::min;
66
use vortex_array::dtype::IntegerPType;
77
use vortex_error::vortex_panic;
88

9-
#[inline]
109
pub fn trimmed_ends_iter<E: IntegerPType>(
1110
run_ends: &[E],
1211
offset: usize,

vortex-array/src/aggregate_fn/fns/nan_count/primitive.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub(super) fn accumulate_primitive(count: &mut u64, p: &PrimitiveArray) -> Vorte
1515
Ok(())
1616
}
1717

18-
#[inline]
1918
fn compute_nan_count_with_validity<T: NativePType>(values: &[T], validity: Mask) -> usize {
2019
match validity {
2120
Mask::AllTrue(_) => values.iter().filter(|v| v.is_nan()).count(),

vortex-array/src/arrays/decimal/compute/min_max.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ impl MinMaxKernel for Decimal {
2828

2929
register_kernel!(MinMaxKernelAdapter(Decimal).lift());
3030

31-
#[inline]
3231
fn compute_min_max_with_validity<D>(array: &DecimalArray) -> VortexResult<Option<MinMaxResult>>
3332
where
3433
D: Into<DecimalValue> + NativeDecimalType,

0 commit comments

Comments
 (0)