Expand description
Pattern matching infrastructure for UOp graphs.
This module provides pattern matching using SimplifiedPatternMatcher, which
uses closures that do inline Rust pattern matching. The patterns! macro
generates closures with native match expressions for O(1) OpKey dispatch.
Modules§
- helpers
- Helper functions for pattern matching.
- simplified
- High-performance pattern matcher with OpKey-based O(1) dispatch.
Structs§
- Simplified
Pattern Matcher - High-performance pattern matcher with O(1) OpKey-based dispatch.
Enums§
- Rewrite
Result - Result of applying a pattern rewrite.
Traits§
- Matcher
- Trait for pattern matchers used by the rewrite engine.
Functions§
- const_
matches - Check if a UOp matches a constant predicate.
- is_
any_ const - Check if a UOp is a pure constant tree (no buffer references).
- is_
neg_ one - Check if a UOp is a negative one constant.
- is_
nonzero - Check if a UOp is a non-zero constant.
- is_one
- Check if a UOp is a one constant.
- is_zero
- Check if a UOp is a zero constant.
- try_
const - Extract const value if present.
Type Aliases§
- Pattern
Closure - Closure type for pattern matching + rewriting.
- Typed
Pattern Matcher - Type alias for backwards compatibility.