authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-04-07 23:11:11-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-04-07 23:19:19-07:00
log6ae8fe193bd5397b9fceea98ba684d9d870286cf
treee2917f745678f883d26c75bcbb546af2a9787cde
parent737ef3e81b4a417b3f81d54a419644fc8fb6b964

Liveness: utilize Air.refToIndex


2 files changed, 2 insertions(+), 6 deletions(-)

src/Liveness.zig+1-3
...@@ -796,9 +796,7 @@ const ExtraTombs = struct {...@@ -796,9 +796,7 @@ const ExtraTombs = struct {
796 assert(this_bit_index < 32); // TODO mechanism for when there are greater than 32 operands796 assert(this_bit_index < 32); // TODO mechanism for when there are greater than 32 operands
797 et.bit_index += 1;797 et.bit_index += 1;
798 const gpa = et.analysis.gpa;798 const gpa = et.analysis.gpa;
799 const op_int = @enumToInt(op_ref);799 const op_index = Air.refToIndex(op_ref) orelse return;
800 if (op_int < Air.Inst.Ref.typed_value_map.len) return;
801 const op_index: Air.Inst.Index = op_int - @intCast(u32, Air.Inst.Ref.typed_value_map.len);
802 const prev = try et.analysis.table.fetchPut(gpa, op_index, {});800 const prev = try et.analysis.table.fetchPut(gpa, op_index, {});
803 if (prev == null) {801 if (prev == null) {
804 // Death.802 // Death.
src/arch/x86_64/CodeGen.zig+1-3
...@@ -280,9 +280,7 @@ const BigTomb = struct {...@@ -280,9 +280,7 @@ const BigTomb = struct {
280 const this_bit_index = bt.bit_index;280 const this_bit_index = bt.bit_index;
281 bt.bit_index += 1;281 bt.bit_index += 1;
282282
283 const op_int = @enumToInt(op_ref);283 const op_index = Air.refToIndex(op_ref) orelse return;
284 if (op_int < Air.Inst.Ref.typed_value_map.len) return;
285 const op_index = @intCast(Air.Inst.Index, op_int - Air.Inst.Ref.typed_value_map.len);
286284
287 if (this_bit_index < Liveness.bpi - 1) {285 if (this_bit_index < Liveness.bpi - 1) {
288 const dies = @truncate(u1, bt.tomb_bits >> @intCast(Liveness.OperandInt, this_bit_index)) != 0;286 const dies = @truncate(u1, bt.tomb_bits >> @intCast(Liveness.OperandInt, this_bit_index)) != 0;