Skip to content

Commit

Permalink
Break the optimiser into separate functions.
Browse files Browse the repository at this point in the history
The optimiser has now exceeded even my (high!) tolerance for long
functions. Previously it was structured as:

```rust
match inst {
  Inst::A => {
    ...
  }
  Inst::B => {
    ...
  }
}
```

where the `...`s could be arbitrarily long.

This commit -- which has no functional change, despite its size! --
changes the structure to:

```rust
match inst {
  Inst::A => self.opt_a(...),
  Inst::B => self.opt_b(...),
}
```

So now each instruction has its "own" function. `opt_binop` is still
fearsomely large, but this commit moves us in a more sustainable
direction.
  • Loading branch information
ltratt committed Jan 24, 2025
1 parent fbd7c22 commit 1151ea8
Showing 1 changed file with 609 additions and 570 deletions.
Loading

0 comments on commit 1151ea8

Please sign in to comment.