# Air: store interned values in Air.Inst.Ref · gitcafe/zig

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

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

Visibility: public

Requested revision: ff37ccd298f0ab28a9d0e0ee1110dadc6db4df1e

Requested commit: ff37ccd298f0ab28a9d0e0ee1110dadc6db4df1e

Commit: ff37ccd298f0ab28a9d0e0ee1110dadc6db4df1e

Tree: 8b7b2ad4bc95f8cbbfd277fbfd7dfd30a7222b3a

Author: mlugg

Committer: Andrew Kelley

## Message

```
Air: store interned values in Air.Inst.Ref

Previously, interned values were represented as AIR instructions using
the `interned` tag. Now, the AIR ref directly encodes the InternPool
index. The encoding works as follows:
* If the ref matches one of the static values, it corresponds to the same InternPool index.
* Otherwise, if the MSB is 0, the ref corresponds to an InternPool index.
* Otherwise, if the MSB is 1, the ref corresponds to an AIR instruction index (after removing the MSB).

Note that since most static InternPool indices are low values (the
exceptions being `.none` and `.var_args_param_type`), the first rule is
almost a nop.

```

## Parents

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

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