Update base for Update on "compiler: allow reordering of loadlocal after last assignment"

Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable.

Thus if we have:

```
t0 = StoreLocal const x = ...
t1 = LoadLocal x
t2 = foo
t3 = bar t1 # t1 used here
```

We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used:

```
t0 = StoreLocal const x = ...
t2 = foo
t1 = LoadLocal x
t3 = bar t1
```

Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR.

[ghstack-poisoned]
This commit is contained in:
Joe Savona
2024-05-30 08:37:21 -07:00
parent 97bd37418e
commit 47e6f155fc

Diff Content Not Available