| 1 | //! Re-exports of IR-walking helpers for the optimizer. |
| 2 | //! |
| 3 | //! Audit B-6: the canonical implementations live in |
| 4 | //! [`crate::ir::walk`]. This module exists so optimizer passes can |
| 5 | //! continue to write `use super::util::...` without each pass needing |
| 6 | //! to reach into `crate::ir::walk` directly. Adding a new helper |
| 7 | //! belongs in `ir/walk.rs`; this file just makes it accessible to |
| 8 | //! the `opt` module tree. |
| 9 | |
| 10 | // `dominator_tree_preorder` lives in `crate::ir::walk` and is tested |
| 11 | // there but no optimizer pass currently consumes it (mem2reg walks |
| 12 | // the dominator tree itself via `dominator_tree_children`). Drop the |
| 13 | // re-export until something actually needs it — the audit (N13) |
| 14 | // flagged it as dead code from this module's perspective. |
| 15 | #[allow(unused_imports)] |
| 16 | pub use crate::ir::walk::{ |
| 17 | compute_dominance_frontiers, compute_dominators, compute_immediate_dominators, |
| 18 | dominator_tree_children, find_natural_loops, for_each_operand_mut, |
| 19 | for_each_terminator_operand_mut, inst_uses, predecessors, prune_unreachable, substitute_uses, |
| 20 | terminator_targets, terminator_uses, NaturalLoop, |
| 21 | }; |
| 22 |