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
//! IR transformation passes.
//!
//! Before a `Program` is lowered to backend code, it runs through a series
//! of target-independent optimizations and transformations: call inlining,
//! common-subexpression elimination, dead-code elimination, and visitor
//! utilities. These passes are the vyre analogue of LLVM's mid-level IR
//! passes.
/// Call inlining transforms.
///
/// This pass expands `Expr::Call` nodes into the callee's IR body,
/// eliminating kernel-dispatch overhead for small compositional ops.
/// Compiler-oriented IR primitives.
/// Shared-nothing parallel dispatch analysis.
/// IR visitor utilities.
///
/// Provides iterative traversal functions that walk nodes and expressions
/// without recursion, preventing stack overflow on deeply nested programs.
/// Induction-variable substitution shared by the optimizer loop passes and the
/// autodiff loop arm. One complete `var -> expr` rewrite over the whole IR.
pub
/// Reverse-mode automatic differentiation via IR transform (RFC 0002).
///
/// Given a forward `Program` + output/input buffer names, emits a backward
/// `Program` computing gradients via the chain rule.
/// Collective communication rewrites shared by reference and GPU backends.