1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! `dominators` - pre-dominator tree (dual of `post_dominates`).
//!
//! Given a CFG and an entry node, computes for every node `n` the
//! set `dom(n)` of nodes that dominate `n`. Used by dataflow consumers for a
//! `dominates($a, $b)` predicate to project "every path from entry
//! to some node in $b passes through a node in $a" onto the per-
//! node bitset the GPU primitive consumes.
//!
//! ## Shape contract
//!
//! Inputs:
//! - `node_count`: total node count.
//! - `dom_set`: per-node bitset where bit `m` of node `n`'s row is
//! set iff `n` dominates `m`. Production construction uses the
//! GPU-resident fixed-point step in this module; [`compute_cpu`]
//! remains only as a parity oracle.
//! - `target_set`: bitset of target nodes the predicate queries.
//! - `out`: bitset; bit `n` set iff `n` dominates SOME target.
//!
//! The query projection matches `post_dominates`: a single `bitset_and`
//! step over a dominator matrix built by GPU fixed-point construction.
#[cfg(any(test, feature = "cpu-parity"))]
mod cpu_oracle;
mod dispatch;
mod program;
mod registry;
mod tag;
#[cfg(test)]
mod tests;
pub(crate) const OP_ID: &str = "weir::dominators";
#[cfg(any(test, feature = "cpu-parity"))]
#[allow(deprecated)]
pub(crate) use cpu_oracle::cpu_ref;
#[cfg(any(test, feature = "cpu-parity"))]
#[allow(deprecated)]
pub(crate) use cpu_oracle::{compute_bitmap_bytes, compute_cpu};
#[cfg(test)]
#[allow(deprecated)]
pub(crate) use dispatch::compute_borrowed_into_via;
#[cfg(any(test, feature = "cpu-parity"))]
#[allow(deprecated)]
pub(crate) use dispatch::compute_via;
pub use program::dominates;
#[cfg(any(test, feature = "cpu-parity"))]
pub(crate) use program::dominator_step;
pub use tag::Dominators;