From f8f9bceb172026bb7433a9a50157bdf95b7eb492 Mon Sep 17 00:00:00 2001 From: Echo J Date: Tue, 5 Mar 2024 23:28:13 +0200 Subject: [PATCH] nak: Rip out a few dead_code statements This is a far less radical solution (but I still removed a decent amount of them) Part-of: --- src/nouveau/compiler/bitview/lib.rs | 3 --- src/nouveau/compiler/nak/bitset.rs | 4 ---- src/nouveau/compiler/nak/ir.rs | 11 ++--------- src/nouveau/compiler/nak/sph.rs | 1 + 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/nouveau/compiler/bitview/lib.rs b/src/nouveau/compiler/bitview/lib.rs index 87600221586..a37f5080031 100644 --- a/src/nouveau/compiler/bitview/lib.rs +++ b/src/nouveau/compiler/bitview/lib.rs @@ -134,7 +134,6 @@ pub struct BitView<'a, BS: BitViewable + ?Sized> { range: Range, } -#[allow(dead_code)] impl<'a, BS: BitViewable + ?Sized> BitView<'a, BS> { pub fn new(parent: &'a BS) -> Self { let len = parent.bits(); @@ -186,7 +185,6 @@ pub struct BitMutView<'a, BS: BitMutViewable + ?Sized> { range: Range, } -#[allow(dead_code)] impl<'a, BS: BitMutViewable + ?Sized> BitMutView<'a, BS> { pub fn new(parent: &'a mut BS) -> Self { let len = parent.bits(); @@ -218,7 +216,6 @@ impl<'a, BS: BitMutViewable + ?Sized> BitMutView<'a, BS> { new_start..new_end } - #[allow(dead_code)] pub fn get_bit(&self, bit: usize) -> bool { self.get_bit_range_u64(bit..(bit + 1)) != 0 } diff --git a/src/nouveau/compiler/nak/bitset.rs b/src/nouveau/compiler/nak/bitset.rs index da55abae315..ff9a3acf117 100644 --- a/src/nouveau/compiler/nak/bitset.rs +++ b/src/nouveau/compiler/nak/bitset.rs @@ -21,7 +21,6 @@ impl BitSet { } } - #[allow(dead_code)] pub fn reserve(&mut self, bits: usize) { self.reserve_words(bits.div_ceil(32)); } @@ -42,7 +41,6 @@ impl BitSet { } } - #[allow(dead_code)] pub fn is_empty(&self) -> bool { for w in self.words.iter() { if *w != 0 { @@ -56,7 +54,6 @@ impl BitSet { self.words.get(word).cloned().unwrap_or(0) } - #[allow(dead_code)] pub fn next_set(&self, start: usize) -> Option { if start >= self.words.len() * 32 { return None; @@ -75,7 +72,6 @@ impl BitSet { None } - #[allow(dead_code)] pub fn next_unset(&self, start: usize) -> usize { if start >= self.words.len() * 32 { return start; diff --git a/src/nouveau/compiler/nak/ir.rs b/src/nouveau/compiler/nak/ir.rs index ecba111dc8e..63fc4f0efcd 100644 --- a/src/nouveau/compiler/nak/ir.rs +++ b/src/nouveau/compiler/nak/ir.rs @@ -350,12 +350,10 @@ impl PerRegFile { } } - #[allow(dead_code)] pub fn values(&self) -> slice::Iter { self.per_file.iter() } - #[allow(dead_code)] pub fn values_mut(&mut self) -> slice::IterMut { self.per_file.iter_mut() } @@ -420,7 +418,6 @@ impl SSAValue { } /// Returns true if this SSA value is equal to SSAValue::NONE - #[allow(dead_code)] pub fn is_none(&self) -> bool { self.packed == 0 } @@ -791,6 +788,7 @@ pub enum SrcRef { } impl SrcRef { + #[allow(dead_code)] pub fn is_alu(&self) -> bool { match self { SrcRef::Zero | SrcRef::Imm32(_) | SrcRef::CBuf(_) => true, @@ -809,6 +807,7 @@ impl SrcRef { } } + #[allow(dead_code)] pub fn is_barrier(&self) -> bool { match self { SrcRef::SSA(ssa) => ssa.file() == RegFile::Bar, @@ -1382,7 +1381,6 @@ macro_rules! impl_display_for_op { }; } -#[allow(dead_code)] #[derive(Clone, Copy, Eq, Hash, PartialEq)] pub enum PredSetOp { And, @@ -1681,7 +1679,6 @@ impl fmt::Display for FloatType { } } -#[allow(dead_code)] #[derive(Clone, Copy, Eq, Hash, PartialEq)] pub enum FRndMode { NearestEven, @@ -1982,7 +1979,6 @@ impl fmt::Display for MemOrder { } } -#[allow(dead_code)] #[derive(Clone, Copy, Eq, Hash, PartialEq)] pub enum MemScope { CTA, @@ -2150,7 +2146,6 @@ impl fmt::Display for AtomOp { } } -#[allow(dead_code)] #[derive(Clone, Copy, Eq, PartialEq)] pub enum InterpFreq { Pass, @@ -2159,7 +2154,6 @@ pub enum InterpFreq { State, } -#[allow(dead_code)] #[derive(Clone, Copy, Eq, PartialEq)] pub enum InterpLoc { Default, @@ -3011,7 +3005,6 @@ impl DisplayOp for OpLop3 { } impl_display_for_op!(OpLop3); -#[allow(dead_code)] #[derive(Clone, Copy, Eq, PartialEq)] pub enum ShflOp { Idx, diff --git a/src/nouveau/compiler/nak/sph.rs b/src/nouveau/compiler/nak/sph.rs index 9e2db02b4e8..cbfd45eac09 100644 --- a/src/nouveau/compiler/nak/sph.rs +++ b/src/nouveau/compiler/nak/sph.rs @@ -455,6 +455,7 @@ impl ShaderProgramHeader { // TODO: This seems always set on fragment shaders, figure out what this is for. #[inline] + #[allow(dead_code)] pub fn set_unknown_bit611(&mut self, value: bool) { assert!(self.shader_type == ShaderType::Fragment); self.set_bit(611, value);