mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 23:53:15 +00:00
Liveness: utilize Air.refToIndex
This commit is contained in:
parent
737ef3e81b
commit
6ae8fe193b
@ -796,9 +796,7 @@ const ExtraTombs = struct {
|
||||
assert(this_bit_index < 32); // TODO mechanism for when there are greater than 32 operands
|
||||
et.bit_index += 1;
|
||||
const gpa = et.analysis.gpa;
|
||||
const op_int = @enumToInt(op_ref);
|
||||
if (op_int < Air.Inst.Ref.typed_value_map.len) return;
|
||||
const op_index: Air.Inst.Index = op_int - @intCast(u32, Air.Inst.Ref.typed_value_map.len);
|
||||
const op_index = Air.refToIndex(op_ref) orelse return;
|
||||
const prev = try et.analysis.table.fetchPut(gpa, op_index, {});
|
||||
if (prev == null) {
|
||||
// Death.
|
||||
|
||||
@ -280,9 +280,7 @@ const BigTomb = struct {
|
||||
const this_bit_index = bt.bit_index;
|
||||
bt.bit_index += 1;
|
||||
|
||||
const op_int = @enumToInt(op_ref);
|
||||
if (op_int < Air.Inst.Ref.typed_value_map.len) return;
|
||||
const op_index = @intCast(Air.Inst.Index, op_int - Air.Inst.Ref.typed_value_map.len);
|
||||
const op_index = Air.refToIndex(op_ref) orelse return;
|
||||
|
||||
if (this_bit_index < Liveness.bpi - 1) {
|
||||
const dies = @truncate(u1, bt.tomb_bits >> @intCast(Liveness.OperandInt, this_bit_index)) != 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user