# wasm: keep \`load\` values on the stack · gitcafe/zig

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

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

Visibility: public

Requested revision: a5e4fd7ef66bbd16ddad1a12d378eefcb740da1d

Requested commit: a5e4fd7ef66bbd16ddad1a12d378eefcb740da1d

Commit: a5e4fd7ef66bbd16ddad1a12d378eefcb740da1d

Tree: da07a631ac4ca59f6f7912e8867a7e3c8240ff55

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: keep `load` values on the stack

We internally use a lot of `load`'s that used to put
the result in a newly created local. For instance, when is considered
byRef or when we need a specific field/element/bytes from a larger type.
However, sometimes we want to directly use this value and then forget about
it, which means storing it in a local first is wasted instructions as well
as wasted locals that shouldn't be generated in the first place.
With this change it's explicit and requires the usage of `toLocal`.

```

## Parents

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

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