Add PartialEq to BoundKind and Value
Implement PartialEq for BoundKind to allow for structural equality checks during optimization. This enables the optimizer to terminate early when a node no longer changes. Also, implement PartialEq for Value to facilitate comparisons between different Value variants.
This commit is contained in:
@@ -24,7 +24,9 @@ impl Optimizer {
|
||||
let mut current = node;
|
||||
for _ in 0..self.max_passes {
|
||||
let next = self.visit_node(current.clone());
|
||||
// TODO: Structural equality check to stop early
|
||||
if next == current {
|
||||
break;
|
||||
}
|
||||
current = next;
|
||||
}
|
||||
current
|
||||
|
||||
Reference in New Issue
Block a user