aboutsummaryrefslogtreecommitdiff
path: root/src/arch/riscv64/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-21 13:32:25 -0700
committerGitHub <noreply@github.com>2023-04-21 13:32:25 -0700
commit528b66f6ec9cfb140abff3dc0c4735c179520f42 (patch)
tree6fc4f164a93a6bd3c2c3467457aedce6fa7959b3 /src/arch/riscv64/CodeGen.zig
parent391663e497f1871f6bddcf9cbc500710aa9aac4d (diff)
parentb3f9fe6d0439bcbb5c6baa77c0646c4da2e06dd7 (diff)
downloadzig-528b66f6ec9cfb140abff3dc0c4735c179520f42.tar.gz
zig-528b66f6ec9cfb140abff3dc0c4735c179520f42.zip
Merge pull request #15355 from mlugg/feat/liveness-control-flow
Liveness: control flow analysis and other goodies
Diffstat (limited to 'src/arch/riscv64/CodeGen.zig')
-rw-r--r--src/arch/riscv64/CodeGen.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/arch/riscv64/CodeGen.zig b/src/arch/riscv64/CodeGen.zig
index 16d9548da7..f0ab8b3317 100644
--- a/src/arch/riscv64/CodeGen.zig
+++ b/src/arch/riscv64/CodeGen.zig
@@ -473,6 +473,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
const air_tags = self.air.instructions.items(.tag);
for (body) |inst| {
+ // TODO: remove now-redundant isUnused calls from AIR handler functions
+ if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
+ continue;
+ }
+
const old_air_bookkeeping = self.air_bookkeeping;
try self.ensureProcessDeathCapacity(Liveness.bpi);