diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-10-05 05:34:42 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-12-12 18:48:10 -0500 |
| commit | 25d3713b07a100d8fdb349317db97fd9d0c1e366 (patch) | |
| tree | e714bd6365744e115b5c5e78caceb70046469482 /src/Compilation.zig | |
| parent | d0eef26687ca2b4b206b70f001741314d4b8bae8 (diff) | |
| download | zig-25d3713b07a100d8fdb349317db97fd9d0c1e366.tar.gz zig-25d3713b07a100d8fdb349317db97fd9d0c1e366.zip | |
stage2: Teach Liveness that safety checks do not modify memory
This change adds to Liveness a simple pattern match for the
try-like `.condbr` blocks emitted by Sema's safety checks. This
allows us to determine that these do not modify memory, which
permits us to elide additional loads in the backend.
As @Vexu points out in the main issue, this is probably not a
complete solution on its own. We'll still want a way to reliably
narrow the load/copy when performing several consecutive accesses,
such as `foo.arr[x][y].z`
Resolves https://github.com/ziglang/zig/issues/12215
Diffstat (limited to 'src/Compilation.zig')
0 files changed, 0 insertions, 0 deletions
