vyre-macros
Proc-macros for the vyre GPU compute IR compiler.
This crate is consumed at compile time only — you do not depend on it directly
in most cases. The vyre crate re-exports everything you need:
use ;
use Program;
Macros
#[vyre_pass(name = "...", requires = [...], invalidates = [...])]
Register a unit struct as an optimizer pass in the global
inventory::collect!(PassRegistration) registry. The scheduler picks it up
automatically and applies it to every Program during vyre::optimize().
The annotated type must expose three inherent methods with exactly the
signatures below — the macro wires them into the Pass trait impl:
use Program;
use ;
;
Arguments
| Argument | Type | Meaning |
|---|---|---|
name |
&'static str |
Stable pass name used in diagnostics and scheduling. |
requires |
&[&str] |
Pass names that must have already run (or analyses that must be available) before this one fires. |
invalidates |
&[&str] |
Analyses invalidated when this pass changes the program. |
Every pass contributes to the shared fixpoint loop — the scheduler keeps
iterating until either every pass reports changed: false or the safety cap
is hit.
See also
vyre::optimizer— the trait definition, registry, and scheduler.vyre-core/src/optimizer/passes/— reference passes (const_fold,strength_reduce, etc.).
License
Dual-licensed under MIT or Apache-2.0 at your option, matching the rest of
the vyre workspace.