diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-21 13:32:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-21 13:32:25 -0700 |
| commit | 528b66f6ec9cfb140abff3dc0c4735c179520f42 (patch) | |
| tree | 6fc4f164a93a6bd3c2c3467457aedce6fa7959b3 /src/arch/arm/CodeGen.zig | |
| parent | 391663e497f1871f6bddcf9cbc500710aa9aac4d (diff) | |
| parent | b3f9fe6d0439bcbb5c6baa77c0646c4da2e06dd7 (diff) | |
| download | zig-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/arm/CodeGen.zig')
| -rw-r--r-- | src/arch/arm/CodeGen.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/arch/arm/CodeGen.zig b/src/arch/arm/CodeGen.zig index 1acf5a5164..661e713b1c 100644 --- a/src/arch/arm/CodeGen.zig +++ b/src/arch/arm/CodeGen.zig @@ -639,6 +639,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); @@ -4923,17 +4928,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(Mir.Inst.Index, 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(); } |
