# CBE: defer invariant local reuse in loops · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/7d3cc3bc8d772519d390b7f13346eeab73bc0c21)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 7d3cc3bc8d772519d390b7f13346eeab73bc0c21

Requested commit: 7d3cc3bc8d772519d390b7f13346eeab73bc0c21

Commit: 7d3cc3bc8d772519d390b7f13346eeab73bc0c21

Tree: 8b9e7c78245891efee3cc8b4f0e3ad770704bb7e

Author: Jacob Young

Committer: Andrew Kelley

## Message

```
CBE: defer invariant local reuse in loops

When a local defined outside a loop dies inside the loop, it can still
be needed on subsequent loop iterations, so reuse of the local must be
deferred until after the loop ends. This causes behavior tests to pass.

```

## Parents

- [518392d6fe79b780164d40782f15e626444d34f8](https://git.cafe/gitcafe/zig/commit/518392d6fe79b780164d40782f15e626444d34f8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/7d3cc3bc8d772519d390b7f13346eeab73bc0c21?format=markdown)
