# stage2: implement register allocation in LLVM self-hosted backend · gitcafe/zig

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

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

Visibility: public

Requested revision: 19cfd310b0d5ba7d9542d50db281035b15daad35

Requested commit: 19cfd310b0d5ba7d9542d50db281035b15daad35

Commit: 19cfd310b0d5ba7d9542d50db281035b15daad35

Tree: 21420f447be61d69549f283b055ae0641696711e

Author: Timon Kruiper

Committer: Timon Kruiper

## Message

````
stage2: implement register allocation in LLVM self-hosted backend

A HashMap has been added which store the LLVM values used in a function.
Together with the alloc and store instructions the following now works:
```
export fn _start() noreturn {
    var x: bool = true;
    exit();
}

fn exit() noreturn {
    unreachable;
}
```

````

## Parents

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

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