aboutsummaryrefslogtreecommitdiff
path: root/src/arch/aarch64/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/aarch64/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/aarch64/CodeGen.zig')
-rw-r--r--src/arch/aarch64/CodeGen.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/arch/aarch64/CodeGen.zig b/src/arch/aarch64/CodeGen.zig
index e08386dfcb..1acc11d7e8 100644
--- a/src/arch/aarch64/CodeGen.zig
+++ b/src/arch/aarch64/CodeGen.zig
@@ -655,6 +655,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);
@@ -5000,17 +5005,11 @@ fn airLoop(self: *Self, inst: Air.Inst.Index) !void {
const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
const loop = self.air.extraData(Air.Block, ty_pl.payload);
const body = self.air.extra[loop.end..][0..loop.data.body_len];
- const liveness_loop = self.liveness.getLoop(inst);
const start_index = @intCast(u32, self.mir_instructions.len);
try self.genBody(body);
try self.jump(start_index);
- try self.ensureProcessDeathCapacity(liveness_loop.deaths.len);
- for (liveness_loop.deaths) |operand| {
- self.processDeath(operand);
- }
-
return self.finishAirBookkeeping();
}