About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Gmeiner <cgmeiner@igalia.com>2025-09-13 00:13:15 +0200
committerMarge Bot <marge-bot@fdo.invalid>2025-09-13 07:30:50 +0000
commit5977c0026d230e7e3ecbf6d1d691891dae20d530 (patch)
treef6a44e26a333f539bde2314dfb14fef42e51ed77
parent5cc0d1b681be7535a00739cbb47c4373d2b6e5f0 (diff)
nak: Move dataflow to compiler crate
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37348>
-rw-r--r--src/compiler/rust/dataflow.rs (renamed from src/nouveau/compiler/nak/dataflow.rs)8
-rw-r--r--src/compiler/rust/lib.rs1
-rw-r--r--src/compiler/rust/meson.build1
-rw-r--r--src/nouveau/compiler/nak/calc_instr_deps.rs2
-rw-r--r--src/nouveau/compiler/nak/lib.rs1
-rw-r--r--src/nouveau/compiler/nak/liveness.rs2
6 files changed, 8 insertions, 7 deletions
diff --git a/src/nouveau/compiler/nak/dataflow.rs b/src/compiler/rust/dataflow.rs
index b9657f7409b..8ea0a839e74 100644
--- a/src/nouveau/compiler/nak/dataflow.rs
+++ b/src/compiler/rust/dataflow.rs
@@ -10,8 +10,8 @@
//! this terminology.
//! https://en.wikipedia.org/wiki/Data-flow_analysis#Basic_principles
-use compiler::bitset::BitSet;
-use compiler::cfg::CFG;
+use crate::bitset::BitSet;
+use crate::cfg::CFG;
use std::collections::VecDeque;
/// A FIFO where each item is unique
@@ -187,8 +187,8 @@ where
#[cfg(test)]
mod tests {
use super::*;
- use compiler::bitset::BitSet;
- use compiler::cfg::CFGBuilder;
+ use crate::bitset::BitSet;
+ use crate::cfg::CFGBuilder;
use std::hash::RandomState;
fn check_graph_reachability(
diff --git a/src/compiler/rust/lib.rs b/src/compiler/rust/lib.rs
index c7555a5c4e8..c7d559b151f 100644
--- a/src/compiler/rust/lib.rs
+++ b/src/compiler/rust/lib.rs
@@ -5,6 +5,7 @@ pub mod as_slice;
pub mod bindings;
pub mod bitset;
pub mod cfg;
+pub mod dataflow;
pub mod memstream;
pub mod nir;
pub mod nir_instr_printer;
diff --git a/src/compiler/rust/meson.build b/src/compiler/rust/meson.build
index 9337408a104..4f0aae835ca 100644
--- a/src/compiler/rust/meson.build
+++ b/src/compiler/rust/meson.build
@@ -5,6 +5,7 @@ _compiler_rs_sources = [
'as_slice.rs',
'bitset.rs',
'cfg.rs',
+ 'dataflow.rs',
'memstream.rs',
'nir_instr_printer.rs',
'nir.rs',
diff --git a/src/nouveau/compiler/nak/calc_instr_deps.rs b/src/nouveau/compiler/nak/calc_instr_deps.rs
index 470fc439c07..7b63858c55d 100644
--- a/src/nouveau/compiler/nak/calc_instr_deps.rs
+++ b/src/nouveau/compiler/nak/calc_instr_deps.rs
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: MIT
use crate::api::{GetDebugFlags, DEBUG};
-use crate::dataflow::ForwardDataflow;
use crate::ir::*;
use crate::opt_instr_sched_common::estimate_block_weight;
use crate::reg_tracker::RegTracker;
+use compiler::dataflow::ForwardDataflow;
use rustc_hash::{FxHashMap, FxHashSet};
use std::cmp::max;
use std::ops::Range;
diff --git a/src/nouveau/compiler/nak/lib.rs b/src/nouveau/compiler/nak/lib.rs
index 66a2e8e0bb7..8e6fa819103 100644
--- a/src/nouveau/compiler/nak/lib.rs
+++ b/src/nouveau/compiler/nak/lib.rs
@@ -6,7 +6,6 @@ mod assign_regs;
mod builder;
mod calc_instr_deps;
mod const_tracker;
-mod dataflow;
mod from_nir;
mod ir;
mod legalize;
diff --git a/src/nouveau/compiler/nak/liveness.rs b/src/nouveau/compiler/nak/liveness.rs
index 3e8ab1d5a14..21cceadebc4 100644
--- a/src/nouveau/compiler/nak/liveness.rs
+++ b/src/nouveau/compiler/nak/liveness.rs
@@ -1,10 +1,10 @@
// Copyright © 2022 Collabora, Ltd.
// SPDX-License-Identifier: MIT
-use crate::dataflow::BackwardDataflow;
use crate::ir::*;
use compiler::bitset::BitSet;
+use compiler::dataflow::BackwardDataflow;
use rustc_hash::{FxHashMap, FxHashSet};
use std::cmp::{max, min, Ord, Ordering};