Module: Mesa
Branch: main
Commit: 03f1b99f50f0a58ac13da675bb1d3c9d8691e4d7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=03f1b99f50f0a58ac13da675bb1d3c9d8691e4d7

Author: Faith Ekstrand <[email protected]>
Date:   Wed Dec  6 08:40:57 2023 -0600

nak: Restructure for better module separation

With this commit, NAK now takes on a more Cargo-like structure with
things split better into crates:

 - bitview/
    - lib.rs // Formerly bitview.rs
 - nak/
    - lib.rs // Only pulls stuff into the module
    - api.rs // Formerly nak.rs
    - ...
 - nvfuzz/
    - main.rs // Formerly nvfuzz.rs

Reviewed-by: Karol Herbst <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>

---

 .../compiler/{bitview.rs => bitview/lib.rs}        |  0
 src/nouveau/compiler/meson.build                   | 29 +++++++++----
 src/nouveau/compiler/{nak.rs => nak/api.rs}        | 47 +++++-----------------
 .../{nak_assign_regs.rs => nak/assign_regs.rs}     |  4 +-
 src/nouveau/compiler/{ => nak}/bitset.rs           |  0
 .../compiler/{nak_builder.rs => nak/builder.rs}    |  2 +-
 .../calc_instr_deps.rs}                            |  4 +-
 src/nouveau/compiler/{nak_cfg.rs => nak/cfg.rs}    |  0
 .../{nak_encode_sm70.rs => nak/encode_sm70.rs}     |  4 +-
 .../compiler/{nak_from_nir.rs => nak/from_nir.rs}  |  6 +--
 src/nouveau/compiler/{nak_ir.rs => nak/ir.rs}      | 14 +++----
 .../compiler/{nak_ir_proc.rs => nak/ir_proc.rs}    |  0
 .../compiler/{nak_legalize.rs => nak/legalize.rs}  |  4 +-
 src/nouveau/compiler/nak/lib.rs                    | 26 ++++++++++++
 .../compiler/{nak_liveness.rs => nak/liveness.rs}  |  2 +-
 .../lower_copy_swap.rs}                            |  2 +-
 .../lower_par_copies.rs}                           |  2 +-
 src/nouveau/compiler/{ => nak}/nir.rs              |  0
 .../{nak_opt_bar_prop.rs => nak/opt_bar_prop.rs}   |  2 +-
 .../{nak_opt_copy_prop.rs => nak/opt_copy_prop.rs} |  2 +-
 .../compiler/{nak_opt_dce.rs => nak/opt_dce.rs}    |  2 +-
 .../compiler/{nak_opt_lop.rs => nak/opt_lop.rs}    |  2 +-
 .../compiler/{nak_opt_out.rs => nak/opt_out.rs}    |  2 +-
 .../{nak_repair_ssa.rs => nak/repair_ssa.rs}       |  2 +-
 src/nouveau/compiler/{nak_sph.rs => nak/sph.rs}    | 16 ++++----
 .../{nak_spill_values.rs => nak/spill_values.rs}   |  6 +--
 .../compiler/{nak_to_cssa.rs => nak/to_cssa.rs}    |  6 +--
 src/nouveau/compiler/{ => nak}/union_find.rs       |  0
 src/nouveau/compiler/{nvfuzz.rs => nvfuzz/main.rs} |  2 +-
 29 files changed, 101 insertions(+), 87 deletions(-)

diff --git a/src/nouveau/compiler/bitview.rs 
b/src/nouveau/compiler/bitview/lib.rs
similarity index 100%
rename from src/nouveau/compiler/bitview.rs
rename to src/nouveau/compiler/bitview/lib.rs
diff --git a/src/nouveau/compiler/meson.build b/src/nouveau/compiler/meson.build
index a6c95c5be6d..ade1e0942d2 100644
--- a/src/nouveau/compiler/meson.build
+++ b/src/nouveau/compiler/meson.build
@@ -28,8 +28,22 @@ libnak_c_files = files(
   'nak_nir_lower_gs_intrinsics.c',
 )
 
-libnak_rs_files = files(
-  'nak.rs',
+_libbitview_rs = static_library(
+  'bitview',
+  files('bitview/lib.rs'),
+  gnu_symbol_visibility : 'hidden',
+  rust_abi : 'rust',
+  rust_args : [
+    # we error on all clippy warnings unless they are disabled
+    '-Dclippy::all',
+    # we want to add asserts in control flow
+    '-Aclippy::assertions_on_constants',
+    # dunno, kind of looks nicier being explicit
+    '-Aclippy::redundant_field_names',
+    '-Aclippy::too_many_arguments',
+    '-Aclippy::type_complexity',
+    '-Anon_snake_case',
+  ],
 )
 
 libnak_deps = [
@@ -80,15 +94,15 @@ libnak_bindings_gen = static_library(
   rust_abi : 'rust',
 )
 
-libnak_ir_proc = rust.proc_macro(
+_libnak_ir_proc_rs = rust.proc_macro(
   'nak_ir_proc',
-  files('nak_ir_proc.rs'),
+  files('nak/ir_proc.rs'),
   dependencies : [dep_syn],
 )
 
 _libnak_rs = static_library(
   'nak_rs',
-  [libnak_rs_files],
+  files('nak/lib.rs'),
   gnu_symbol_visibility : 'hidden',
   rust_abi : 'c',
   rust_args : [
@@ -102,7 +116,7 @@ _libnak_rs = static_library(
     '-Aclippy::type_complexity',
     '-Anon_snake_case',
   ],
-  link_with: [libnak_bindings_gen, libnak_ir_proc],
+  link_with: [_libbitview_rs, libnak_bindings_gen, _libnak_ir_proc_rs],
 )
 
 _libnak = static_library(
@@ -118,8 +132,9 @@ _libnak = static_library(
 if with_tools.contains('nouveau')
   executable(
     'nvfuzz',
-    files('nvfuzz.rs'),
+    files('nvfuzz/main.rs'),
     rust_crate_type : 'bin',
+    link_with: [_libbitview_rs],
     install : true
   )
 endif
diff --git a/src/nouveau/compiler/nak.rs b/src/nouveau/compiler/nak/api.rs
similarity index 94%
rename from src/nouveau/compiler/nak.rs
rename to src/nouveau/compiler/nak/api.rs
index 14780ef4925..80ddac62f43 100644
--- a/src/nouveau/compiler/nak.rs
+++ b/src/nouveau/compiler/nak/api.rs
@@ -1,37 +1,12 @@
-/*
- * Copyright © 2022 Collabora, Ltd.
- * SPDX-License-Identifier: MIT
- */
-
-mod bitset;
-mod bitview;
-mod nak_assign_regs;
-mod nak_builder;
-mod nak_calc_instr_deps;
-mod nak_cfg;
-mod nak_encode_sm70;
-mod nak_from_nir;
-mod nak_ir;
-mod nak_legalize;
-mod nak_liveness;
-mod nak_lower_copy_swap;
-mod nak_lower_par_copies;
-mod nak_opt_bar_prop;
-mod nak_opt_copy_prop;
-mod nak_opt_dce;
-mod nak_opt_lop;
-mod nak_opt_out;
-mod nak_repair_ssa;
-mod nak_sph;
-mod nak_spill_values;
-mod nak_to_cssa;
-mod nir;
-
-use crate::nak_ir::ShaderStageInfo;
+// Copyright © 2022 Collabora, Ltd.
+// SPDX-License-Identifier: MIT
+
+use crate::from_nir::*;
+use crate::ir::{ShaderIoInfo, ShaderStageInfo};
+use crate::sph;
 
 use nak_bindings::*;
-use nak_from_nir::*;
-use nak_ir::ShaderIoInfo;
+
 use std::cmp::max;
 use std::env;
 use std::ffi::{CStr, CString};
@@ -46,7 +21,7 @@ enum DebugFlags {
     Spill,
 }
 
-struct Debug {
+pub struct Debug {
     flags: u32,
 }
 
@@ -73,7 +48,7 @@ impl Debug {
     }
 }
 
-trait GetDebugFlags {
+pub trait GetDebugFlags {
     fn debug_flags(&self) -> u32;
 
     fn print(&self) -> bool {
@@ -89,7 +64,7 @@ trait GetDebugFlags {
     }
 }
 
-static DEBUG: OnceLock<Debug> = OnceLock::new();
+pub static DEBUG: OnceLock<Debug> = OnceLock::new();
 
 impl GetDebugFlags for OnceLock<Debug> {
     fn debug_flags(&self) -> u32 {
@@ -397,7 +372,7 @@ pub extern "C" fn nak_compile_shader(
             }
             _ => unsafe { std::mem::zeroed() },
         },
-        hdr: nak_sph::encode_header(&s.info, fs_key),
+        hdr: sph::encode_header(&s.info, fs_key),
     };
 
     let mut asm = String::new();
diff --git a/src/nouveau/compiler/nak_assign_regs.rs 
b/src/nouveau/compiler/nak/assign_regs.rs
similarity index 99%
rename from src/nouveau/compiler/nak_assign_regs.rs
rename to src/nouveau/compiler/nak/assign_regs.rs
index fe4de103c26..a5ab1a35328 100644
--- a/src/nouveau/compiler/nak_assign_regs.rs
+++ b/src/nouveau/compiler/nak/assign_regs.rs
@@ -4,8 +4,8 @@
  */
 
 use crate::bitset::BitSet;
-use crate::nak_ir::*;
-use crate::nak_liveness::{BlockLiveness, Liveness, SimpleLiveness};
+use crate::ir::*;
+use crate::liveness::{BlockLiveness, Liveness, SimpleLiveness};
 
 use std::cmp::{max, Ordering};
 use std::collections::{HashMap, HashSet};
diff --git a/src/nouveau/compiler/bitset.rs b/src/nouveau/compiler/nak/bitset.rs
similarity index 100%
rename from src/nouveau/compiler/bitset.rs
rename to src/nouveau/compiler/nak/bitset.rs
diff --git a/src/nouveau/compiler/nak_builder.rs 
b/src/nouveau/compiler/nak/builder.rs
similarity index 99%
rename from src/nouveau/compiler/nak_builder.rs
rename to src/nouveau/compiler/nak/builder.rs
index 0eb2cf5e955..3f2cd511735 100644
--- a/src/nouveau/compiler/nak_builder.rs
+++ b/src/nouveau/compiler/nak/builder.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 pub trait Builder {
     fn push_instr(&mut self, instr: Box<Instr>) -> &mut Instr;
diff --git a/src/nouveau/compiler/nak_calc_instr_deps.rs 
b/src/nouveau/compiler/nak/calc_instr_deps.rs
similarity index 99%
rename from src/nouveau/compiler/nak_calc_instr_deps.rs
rename to src/nouveau/compiler/nak/calc_instr_deps.rs
index 9395efc3968..0824fe855d9 100644
--- a/src/nouveau/compiler/nak_calc_instr_deps.rs
+++ b/src/nouveau/compiler/nak/calc_instr_deps.rs
@@ -1,8 +1,8 @@
 // Copyright © 2022 Collabora, Ltd.
 // SPDX-License-Identifier: MIT
 
-use crate::nak_ir::*;
-use crate::{GetDebugFlags, DEBUG};
+use crate::api::{GetDebugFlags, DEBUG};
+use crate::ir::*;
 
 use std::cmp::max;
 use std::collections::HashSet;
diff --git a/src/nouveau/compiler/nak_cfg.rs b/src/nouveau/compiler/nak/cfg.rs
similarity index 100%
rename from src/nouveau/compiler/nak_cfg.rs
rename to src/nouveau/compiler/nak/cfg.rs
diff --git a/src/nouveau/compiler/nak_encode_sm70.rs 
b/src/nouveau/compiler/nak/encode_sm70.rs
similarity index 99%
rename from src/nouveau/compiler/nak_encode_sm70.rs
rename to src/nouveau/compiler/nak/encode_sm70.rs
index 15a6527dcff..ee83be9a627 100644
--- a/src/nouveau/compiler/nak_encode_sm70.rs
+++ b/src/nouveau/compiler/nak/encode_sm70.rs
@@ -3,8 +3,8 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::bitview::*;
-use crate::nak_ir::*;
+use crate::ir::*;
+use bitview::*;
 
 use std::collections::HashMap;
 use std::ops::Range;
diff --git a/src/nouveau/compiler/nak_from_nir.rs 
b/src/nouveau/compiler/nak/from_nir.rs
similarity index 99%
rename from src/nouveau/compiler/nak_from_nir.rs
rename to src/nouveau/compiler/nak/from_nir.rs
index ccc8a08169b..1e308f2f635 100644
--- a/src/nouveau/compiler/nak_from_nir.rs
+++ b/src/nouveau/compiler/nak/from_nir.rs
@@ -5,10 +5,10 @@
 
 #![allow(non_upper_case_globals)]
 
-use crate::nak_cfg::CFGBuilder;
-use crate::nak_ir::*;
-use crate::nak_sph::{OutputTopology, PixelImap};
+use crate::cfg::CFGBuilder;
+use crate::ir::*;
 use crate::nir::*;
+use crate::sph::{OutputTopology, PixelImap};
 
 use nak_bindings::*;
 
diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak/ir.rs
similarity index 99%
rename from src/nouveau/compiler/nak_ir.rs
rename to src/nouveau/compiler/nak/ir.rs
index 1a8a47d5e78..a5ce6b83bde 100644
--- a/src/nouveau/compiler/nak_ir.rs
+++ b/src/nouveau/compiler/nak/ir.rs
@@ -3,15 +3,15 @@
  * SPDX-License-Identifier: MIT
  */
 
+extern crate bitview;
 extern crate nak_ir_proc;
 
-use crate::bitview::BitMutView;
-pub use crate::nak_builder::{
-    Builder, InstrBuilder, SSABuilder, SSAInstrBuilder,
-};
-use crate::nak_cfg::CFG;
-use crate::nak_sph::{OutputTopology, PixelImap};
-use crate::{GetDebugFlags, DEBUG};
+use bitview::BitMutView;
+
+use crate::api::{GetDebugFlags, DEBUG};
+pub use crate::builder::{Builder, InstrBuilder, SSABuilder, SSAInstrBuilder};
+use crate::cfg::CFG;
+use crate::sph::{OutputTopology, PixelImap};
 use nak_ir_proc::*;
 use std::cmp::{max, min};
 use std::fmt;
diff --git a/src/nouveau/compiler/nak_ir_proc.rs 
b/src/nouveau/compiler/nak/ir_proc.rs
similarity index 100%
rename from src/nouveau/compiler/nak_ir_proc.rs
rename to src/nouveau/compiler/nak/ir_proc.rs
diff --git a/src/nouveau/compiler/nak_legalize.rs 
b/src/nouveau/compiler/nak/legalize.rs
similarity index 99%
rename from src/nouveau/compiler/nak_legalize.rs
rename to src/nouveau/compiler/nak/legalize.rs
index 1cfe36e3c5c..61b7e02a7d3 100644
--- a/src/nouveau/compiler/nak_legalize.rs
+++ b/src/nouveau/compiler/nak/legalize.rs
@@ -3,8 +3,8 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
-use crate::nak_liveness::{BlockLiveness, Liveness, SimpleLiveness};
+use crate::ir::*;
+use crate::liveness::{BlockLiveness, Liveness, SimpleLiveness};
 
 use std::collections::{HashMap, HashSet};
 
diff --git a/src/nouveau/compiler/nak/lib.rs b/src/nouveau/compiler/nak/lib.rs
new file mode 100644
index 00000000000..8485bde18d1
--- /dev/null
+++ b/src/nouveau/compiler/nak/lib.rs
@@ -0,0 +1,26 @@
+// Copyright © 2023 Collabora, Ltd.
+// SPDX-License-Identifier: MIT
+
+mod api;
+mod assign_regs;
+mod bitset;
+mod builder;
+mod calc_instr_deps;
+mod cfg;
+mod encode_sm70;
+mod from_nir;
+mod ir;
+mod legalize;
+mod liveness;
+mod lower_copy_swap;
+mod lower_par_copies;
+mod nir;
+mod opt_bar_prop;
+mod opt_copy_prop;
+mod opt_dce;
+mod opt_lop;
+mod opt_out;
+mod repair_ssa;
+mod sph;
+mod spill_values;
+mod to_cssa;
diff --git a/src/nouveau/compiler/nak_liveness.rs 
b/src/nouveau/compiler/nak/liveness.rs
similarity index 99%
rename from src/nouveau/compiler/nak_liveness.rs
rename to src/nouveau/compiler/nak/liveness.rs
index 4050555b622..aa460567a6c 100644
--- a/src/nouveau/compiler/nak_liveness.rs
+++ b/src/nouveau/compiler/nak/liveness.rs
@@ -4,7 +4,7 @@
  */
 
 use crate::bitset::BitSet;
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::cell::RefCell;
 use std::cmp::{max, Ord, Ordering};
diff --git a/src/nouveau/compiler/nak_lower_copy_swap.rs 
b/src/nouveau/compiler/nak/lower_copy_swap.rs
similarity index 99%
rename from src/nouveau/compiler/nak_lower_copy_swap.rs
rename to src/nouveau/compiler/nak/lower_copy_swap.rs
index e6300426bef..43ea790815d 100644
--- a/src/nouveau/compiler/nak_lower_copy_swap.rs
+++ b/src/nouveau/compiler/nak/lower_copy_swap.rs
@@ -1,7 +1,7 @@
 // Copyright © 2022 Collabora, Ltd.
 // SPDX-License-Identifier: MIT
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::cmp::max;
 
diff --git a/src/nouveau/compiler/nak_lower_par_copies.rs 
b/src/nouveau/compiler/nak/lower_par_copies.rs
similarity index 99%
rename from src/nouveau/compiler/nak_lower_par_copies.rs
rename to src/nouveau/compiler/nak/lower_par_copies.rs
index c28f7a98d61..00bc060cdf4 100644
--- a/src/nouveau/compiler/nak_lower_par_copies.rs
+++ b/src/nouveau/compiler/nak/lower_par_copies.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::collections::HashMap;
 
diff --git a/src/nouveau/compiler/nir.rs b/src/nouveau/compiler/nak/nir.rs
similarity index 100%
rename from src/nouveau/compiler/nir.rs
rename to src/nouveau/compiler/nak/nir.rs
diff --git a/src/nouveau/compiler/nak_opt_bar_prop.rs 
b/src/nouveau/compiler/nak/opt_bar_prop.rs
similarity index 99%
rename from src/nouveau/compiler/nak_opt_bar_prop.rs
rename to src/nouveau/compiler/nak/opt_bar_prop.rs
index e0dab3abef0..6d28bbd4121 100644
--- a/src/nouveau/compiler/nak_opt_bar_prop.rs
+++ b/src/nouveau/compiler/nak/opt_bar_prop.rs
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: MIT
 
 use crate::bitset::BitSet;
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::collections::HashMap;
 
diff --git a/src/nouveau/compiler/nak_opt_copy_prop.rs 
b/src/nouveau/compiler/nak/opt_copy_prop.rs
similarity index 99%
rename from src/nouveau/compiler/nak_opt_copy_prop.rs
rename to src/nouveau/compiler/nak/opt_copy_prop.rs
index 6ebd366900d..d89fd0aadcb 100644
--- a/src/nouveau/compiler/nak_opt_copy_prop.rs
+++ b/src/nouveau/compiler/nak/opt_copy_prop.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::collections::HashMap;
 
diff --git a/src/nouveau/compiler/nak_opt_dce.rs 
b/src/nouveau/compiler/nak/opt_dce.rs
similarity index 99%
rename from src/nouveau/compiler/nak_opt_dce.rs
rename to src/nouveau/compiler/nak/opt_dce.rs
index a3961c6090e..5e1def68dcb 100644
--- a/src/nouveau/compiler/nak_opt_dce.rs
+++ b/src/nouveau/compiler/nak/opt_dce.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::collections::HashSet;
 
diff --git a/src/nouveau/compiler/nak_opt_lop.rs 
b/src/nouveau/compiler/nak/opt_lop.rs
similarity index 99%
rename from src/nouveau/compiler/nak_opt_lop.rs
rename to src/nouveau/compiler/nak/opt_lop.rs
index 6192d0d54d6..064b1caacba 100644
--- a/src/nouveau/compiler/nak_opt_lop.rs
+++ b/src/nouveau/compiler/nak/opt_lop.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::collections::HashMap;
 use std::slice;
diff --git a/src/nouveau/compiler/nak_opt_out.rs 
b/src/nouveau/compiler/nak/opt_out.rs
similarity index 98%
rename from src/nouveau/compiler/nak_opt_out.rs
rename to src/nouveau/compiler/nak/opt_out.rs
index c698119828d..8ff9668d25a 100644
--- a/src/nouveau/compiler/nak_opt_out.rs
+++ b/src/nouveau/compiler/nak/opt_out.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-use crate::nak_ir::*;
+use crate::ir::*;
 
 fn try_combine_outs(emit: &mut Instr, cut: &Instr) -> bool {
     let Op::Out(emit) = &mut emit.op else {
diff --git a/src/nouveau/compiler/nak_repair_ssa.rs 
b/src/nouveau/compiler/nak/repair_ssa.rs
similarity index 99%
rename from src/nouveau/compiler/nak_repair_ssa.rs
rename to src/nouveau/compiler/nak/repair_ssa.rs
index 8761e341d3a..07272891e40 100644
--- a/src/nouveau/compiler/nak_repair_ssa.rs
+++ b/src/nouveau/compiler/nak/repair_ssa.rs
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: MIT
 
 use crate::bitset::BitSet;
-use crate::nak_ir::*;
+use crate::ir::*;
 
 use std::cell::RefCell;
 use std::collections::HashMap;
diff --git a/src/nouveau/compiler/nak_sph.rs b/src/nouveau/compiler/nak/sph.rs
similarity index 98%
rename from src/nouveau/compiler/nak_sph.rs
rename to src/nouveau/compiler/nak/sph.rs
index 1b8a7f8754f..034ab999e6f 100644
--- a/src/nouveau/compiler/nak_sph.rs
+++ b/src/nouveau/compiler/nak/sph.rs
@@ -1,17 +1,15 @@
 // Copyright © 2023 Collabora, Ltd.
 // SPDX-License-Identifier: MIT
 
-use std::ops::Range;
-
-use nak_bindings::*;
+extern crate bitview;
 
-use crate::{
-    bitview::{
-        BitMutView, BitMutViewable, BitView, BitViewable, SetBit, SetField,
-        SetFieldU64,
-    },
-    nak_ir::{ShaderInfo, ShaderIoInfo, ShaderStageInfo},
+use crate::ir::{ShaderInfo, ShaderIoInfo, ShaderStageInfo};
+use bitview::{
+    BitMutView, BitMutViewable, BitView, BitViewable, SetBit, SetField,
+    SetFieldU64,
 };
+use nak_bindings::*;
+use std::ops::Range;
 
 pub const _FERMI_SHADER_HEADER_SIZE: usize = 20;
 pub const TURING_SHADER_HEADER_SIZE: usize = 32;
diff --git a/src/nouveau/compiler/nak_spill_values.rs 
b/src/nouveau/compiler/nak/spill_values.rs
similarity index 99%
rename from src/nouveau/compiler/nak_spill_values.rs
rename to src/nouveau/compiler/nak/spill_values.rs
index 9c398f3aa26..a245d730925 100644
--- a/src/nouveau/compiler/nak_spill_values.rs
+++ b/src/nouveau/compiler/nak/spill_values.rs
@@ -3,12 +3,12 @@
 
 #![allow(unstable_name_collisions)]
 
+use crate::api::{GetDebugFlags, DEBUG};
 use crate::bitset::BitSet;
-use crate::nak_ir::*;
-use crate::nak_liveness::{
+use crate::ir::*;
+use crate::liveness::{
     BlockLiveness, LiveSet, Liveness, NextUseBlockLiveness, NextUseLiveness,
 };
-use crate::{GetDebugFlags, DEBUG};
 
 use std::cell::RefCell;
 use std::cmp::{max, Ordering, Reverse};
diff --git a/src/nouveau/compiler/nak_to_cssa.rs 
b/src/nouveau/compiler/nak/to_cssa.rs
similarity index 99%
rename from src/nouveau/compiler/nak_to_cssa.rs
rename to src/nouveau/compiler/nak/to_cssa.rs
index 906bbdb2386..6846ecc1f22 100644
--- a/src/nouveau/compiler/nak_to_cssa.rs
+++ b/src/nouveau/compiler/nak/to_cssa.rs
@@ -1,9 +1,9 @@
 // Copyright © 2023 Collabora, Ltd.
 // SPDX-License-Identifier: MIT
 
-use crate::nak_cfg::CFG;
-use crate::nak_ir::*;
-use crate::nak_liveness::{BlockLiveness, Liveness, SimpleLiveness};
+use crate::cfg::CFG;
+use crate::ir::*;
+use crate::liveness::{BlockLiveness, Liveness, SimpleLiveness};
 
 use std::collections::HashMap;
 use std::iter::Peekable;
diff --git a/src/nouveau/compiler/union_find.rs 
b/src/nouveau/compiler/nak/union_find.rs
similarity index 100%
rename from src/nouveau/compiler/union_find.rs
rename to src/nouveau/compiler/nak/union_find.rs
diff --git a/src/nouveau/compiler/nvfuzz.rs 
b/src/nouveau/compiler/nvfuzz/main.rs
similarity index 99%
rename from src/nouveau/compiler/nvfuzz.rs
rename to src/nouveau/compiler/nvfuzz/main.rs
index 07218565420..e3df034f9b3 100644
--- a/src/nouveau/compiler/nvfuzz.rs
+++ b/src/nouveau/compiler/nvfuzz/main.rs
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-mod bitview;
+extern crate bitview;
 
 use crate::bitview::*;
 

Reply via email to