authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-04-19 01:58:39+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-04-20 20:49:34+01:00
log6f09a7041ecf328f761df60fae007c800ee1e2ec
tree4083f83a3f90e1e4725026243eb1b7bc64b3f977
parente0886506531d662067ae42ade9f099ff9c940f58
signature Commit is signed but in an unrecognized format.

Begin integrating new liveness analysis into remaining backends


6 files changed, 30 insertions(+), 0 deletions(-)

src/arch/aarch64/CodeGen.zig+5
...@@ -655,6 +655,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -655,6 +655,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
655 const air_tags = self.air.instructions.items(.tag);655 const air_tags = self.air.instructions.items(.tag);
656656
657 for (body) |inst| {657 for (body) |inst| {
658 // TODO: remove now-redundant isUnused calls from AIR handler functions
659 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
660 continue;
661 }
662
658 const old_air_bookkeeping = self.air_bookkeeping;663 const old_air_bookkeeping = self.air_bookkeeping;
659 try self.ensureProcessDeathCapacity(Liveness.bpi);664 try self.ensureProcessDeathCapacity(Liveness.bpi);
660665
src/arch/arm/CodeGen.zig+5
...@@ -639,6 +639,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -639,6 +639,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
639 const air_tags = self.air.instructions.items(.tag);639 const air_tags = self.air.instructions.items(.tag);
640640
641 for (body) |inst| {641 for (body) |inst| {
642 // TODO: remove now-redundant isUnused calls from AIR handler functions
643 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
644 continue;
645 }
646
642 const old_air_bookkeeping = self.air_bookkeeping;647 const old_air_bookkeeping = self.air_bookkeeping;
643 try self.ensureProcessDeathCapacity(Liveness.bpi);648 try self.ensureProcessDeathCapacity(Liveness.bpi);
644649
src/arch/riscv64/CodeGen.zig+5
...@@ -473,6 +473,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -473,6 +473,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
473 const air_tags = self.air.instructions.items(.tag);473 const air_tags = self.air.instructions.items(.tag);
474474
475 for (body) |inst| {475 for (body) |inst| {
476 // TODO: remove now-redundant isUnused calls from AIR handler functions
477 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
478 continue;
479 }
480
476 const old_air_bookkeeping = self.air_bookkeeping;481 const old_air_bookkeeping = self.air_bookkeeping;
477 try self.ensureProcessDeathCapacity(Liveness.bpi);482 try self.ensureProcessDeathCapacity(Liveness.bpi);
478483
src/arch/sparc64/CodeGen.zig+5
...@@ -489,6 +489,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -489,6 +489,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
489 const air_tags = self.air.instructions.items(.tag);489 const air_tags = self.air.instructions.items(.tag);
490490
491 for (body) |inst| {491 for (body) |inst| {
492 // TODO: remove now-redundant isUnused calls from AIR handler functions
493 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
494 continue;
495 }
496
492 const old_air_bookkeeping = self.air_bookkeeping;497 const old_air_bookkeeping = self.air_bookkeeping;
493 try self.ensureProcessDeathCapacity(Liveness.bpi);498 try self.ensureProcessDeathCapacity(Liveness.bpi);
494499
src/arch/x86_64/CodeGen.zig+5
...@@ -905,6 +905,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -905,6 +905,11 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
905 const air_tags = self.air.instructions.items(.tag);905 const air_tags = self.air.instructions.items(.tag);
906906
907 for (body) |inst| {907 for (body) |inst| {
908 // TODO: remove now-redundant isUnused calls from AIR handler functions
909 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
910 continue;
911 }
912
908 const old_air_bookkeeping = self.air_bookkeeping;913 const old_air_bookkeeping = self.air_bookkeeping;
909 try self.ensureProcessDeathCapacity(Liveness.bpi);914 try self.ensureProcessDeathCapacity(Liveness.bpi);
910 if (builtin.mode == .Debug) {915 if (builtin.mode == .Debug) {
src/codegen/spirv.zig+5
...@@ -1507,6 +1507,11 @@ pub const DeclGen = struct {...@@ -1507,6 +1507,11 @@ pub const DeclGen = struct {
1507 }1507 }
15081508
1509 fn genInst(self: *DeclGen, inst: Air.Inst.Index) !void {1509 fn genInst(self: *DeclGen, inst: Air.Inst.Index) !void {
1510 // TODO: remove now-redundant isUnused calls from AIR handler functions
1511 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
1512 return;
1513 }
1514
1510 const air_tags = self.air.instructions.items(.tag);1515 const air_tags = self.air.instructions.items(.tag);
1511 const maybe_result_id: ?IdRef = switch (air_tags[inst]) {1516 const maybe_result_id: ?IdRef = switch (air_tags[inst]) {
1512 // zig fmt: off1517 // zig fmt: off