authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2024-02-09 12:50:23+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2024-02-10 09:50:02+03:30
log72bd1cd378dcdb96217473baee899528c21bcbbc
tree392e3e7d57e0ab3ede27c22816fdc2f9eee09ad5
parent5ee96688a7456b9581fa605520fe90f6723bb95b

spirv: remove now-redundant isUnused calls from AIR handler functions


1 files changed, 11 insertions(+), 88 deletions(-)

src/codegen/spirv.zig+11-88
......@@ -947,19 +947,19 @@ const DeclGen = struct {
947947 .bytes => |bytes| {
948948 // TODO: This is really space inefficient, perhaps there is a better
949949 // way to do it?
950 for (constituents, bytes) |*constituent, byte| {
951 constituent.* = try self.constInt(elem_ty_ref, byte);
950 for (bytes, 0..) |byte, i| {
951 constituents[i] = try self.constInt(elem_ty_ref, byte);
952952 }
953953 },
954954 .elems => |elems| {
955 for (constituents, elems) |*constituent, elem| {
956 constituent.* = try self.constant(elem_ty, Value.fromInterned(elem), .indirect);
955 for (0..@as(usize, @intCast(array_type.len))) |i| {
956 constituents[i] = try self.constant(elem_ty, Value.fromInterned(elems[i]), .indirect);
957957 }
958958 },
959959 .repeated_elem => |elem| {
960960 const val_id = try self.constant(elem_ty, Value.fromInterned(elem), .indirect);
961 for (constituents) |*constituent| {
962 constituent.* = val_id;
961 for (0..@as(usize, @intCast(array_type.len))) |i| {
962 constituents[i] = val_id;
963963 }
964964 },
965965 }
......@@ -2199,7 +2199,6 @@ const DeclGen = struct {
21992199 fn genInst(self: *DeclGen, inst: Air.Inst.Index) !void {
22002200 const mod = self.module;
22012201 const ip = &mod.intern_pool;
2202 // TODO: remove now-redundant isUnused calls from AIR handler functions
22032202 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst, ip))
22042203 return;
22052204
......@@ -2365,8 +2364,6 @@ const DeclGen = struct {
23652364 }
23662365
23672366 fn airBinOpSimple(self: *DeclGen, inst: Air.Inst.Index, comptime opcode: Opcode) !?IdRef {
2368 if (self.liveness.isUnused(inst)) return null;
2369
23702367 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
23712368 const lhs_id = try self.resolve(bin_op.lhs);
23722369 const rhs_id = try self.resolve(bin_op.rhs);
......@@ -2376,7 +2373,6 @@ const DeclGen = struct {
23762373 }
23772374
23782375 fn airShift(self: *DeclGen, inst: Air.Inst.Index, comptime unsigned: Opcode, comptime signed: Opcode) !?IdRef {
2379 if (self.liveness.isUnused(inst)) return null;
23802376 const mod = self.module;
23812377 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
23822378 const lhs_id = try self.resolve(bin_op.lhs);
......@@ -2431,8 +2427,6 @@ const DeclGen = struct {
24312427 }
24322428
24332429 fn airMinMax(self: *DeclGen, inst: Air.Inst.Index, op: std.math.CompareOperator) !?IdRef {
2434 if (self.liveness.isUnused(inst)) return null;
2435
24362430 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
24372431 const lhs_id = try self.resolve(bin_op.lhs);
24382432 const rhs_id = try self.resolve(bin_op.rhs);
......@@ -2544,7 +2538,6 @@ const DeclGen = struct {
25442538 comptime sop: Opcode,
25452539 comptime uop: Opcode,
25462540 ) !?IdRef {
2547 if (self.liveness.isUnused(inst)) return null;
25482541
25492542 // LHS and RHS are guaranteed to have the same type, and AIR guarantees
25502543 // the result to be the same as the LHS and RHS, which matches SPIR-V.
......@@ -2614,8 +2607,6 @@ const DeclGen = struct {
26142607 }
26152608
26162609 fn airAbs(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
2617 if (self.liveness.isUnused(inst)) return null;
2618
26192610 const mod = self.module;
26202611 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
26212612 const operand_id = try self.resolve(ty_op.operand);
......@@ -2678,8 +2669,6 @@ const DeclGen = struct {
26782669 comptime ucmp: Opcode,
26792670 comptime scmp: Opcode,
26802671 ) !?IdRef {
2681 if (self.liveness.isUnused(inst)) return null;
2682
26832672 const mod = self.module;
26842673 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
26852674 const extra = self.air.extraData(Air.Bin, ty_pl.payload).data;
......@@ -2793,7 +2782,6 @@ const DeclGen = struct {
27932782 }
27942783
27952784 fn airShlOverflow(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
2796 if (self.liveness.isUnused(inst)) return null;
27972785 const mod = self.module;
27982786 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
27992787 const extra = self.air.extraData(Air.Bin, ty_pl.payload).data;
......@@ -2887,8 +2875,6 @@ const DeclGen = struct {
28872875 }
28882876
28892877 fn airMulAdd(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
2890 if (self.liveness.isUnused(inst)) return null;
2891
28922878 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
28932879 const extra = self.air.extraData(Air.Bin, pl_op.payload).data;
28942880
......@@ -2923,7 +2909,6 @@ const DeclGen = struct {
29232909 }
29242910
29252911 fn airSplat(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
2926 if (self.liveness.isUnused(inst)) return null;
29272912 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
29282913 const operand_id = try self.resolve(ty_op.operand);
29292914 const result_ty = self.typeOfIndex(inst);
......@@ -2934,7 +2919,6 @@ const DeclGen = struct {
29342919 }
29352920
29362921 fn airReduce(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
2937 if (self.liveness.isUnused(inst)) return null;
29382922 const mod = self.module;
29392923 const reduce = self.air.instructions.items(.data)[@intFromEnum(inst)].reduce;
29402924 const operand = try self.resolve(reduce.operand);
......@@ -3002,7 +2986,6 @@ const DeclGen = struct {
30022986
30032987 fn airShuffle(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
30042988 const mod = self.module;
3005 if (self.liveness.isUnused(inst)) return null;
30062989 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
30072990 const extra = self.air.extraData(Air.Shuffle, ty_pl.payload).data;
30082991 const a = try self.resolve(extra.a);
......@@ -3115,7 +3098,6 @@ const DeclGen = struct {
31153098 }
31163099
31173100 fn airPtrAdd(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3118 if (self.liveness.isUnused(inst)) return null;
31193101 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
31203102 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
31213103 const ptr_id = try self.resolve(bin_op.lhs);
......@@ -3127,7 +3109,6 @@ const DeclGen = struct {
31273109 }
31283110
31293111 fn airPtrSub(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3130 if (self.liveness.isUnused(inst)) return null;
31313112 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
31323113 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
31333114 const ptr_id = try self.resolve(bin_op.lhs);
......@@ -3303,7 +3284,6 @@ const DeclGen = struct {
33033284 inst: Air.Inst.Index,
33043285 comptime op: std.math.CompareOperator,
33053286 ) !?IdRef {
3306 if (self.liveness.isUnused(inst)) return null;
33073287 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
33083288 const lhs_id = try self.resolve(bin_op.lhs);
33093289 const rhs_id = try self.resolve(bin_op.rhs);
......@@ -3314,8 +3294,6 @@ const DeclGen = struct {
33143294 }
33153295
33163296 fn airVectorCmp(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3317 if (self.liveness.isUnused(inst)) return null;
3318
33193297 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
33203298 const vec_cmp = self.air.extraData(Air.VectorCmp, ty_pl.payload).data;
33213299 const lhs_id = try self.resolve(vec_cmp.lhs);
......@@ -3397,7 +3375,6 @@ const DeclGen = struct {
33973375 }
33983376
33993377 fn airBitCast(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3400 if (self.liveness.isUnused(inst)) return null;
34013378 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
34023379 const operand_id = try self.resolve(ty_op.operand);
34033380 const operand_ty = self.typeOf(ty_op.operand);
......@@ -3406,8 +3383,6 @@ const DeclGen = struct {
34063383 }
34073384
34083385 fn airIntCast(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3409 if (self.liveness.isUnused(inst)) return null;
3410
34113386 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
34123387 const operand_id = try self.resolve(ty_op.operand);
34133388 const src_ty = self.typeOf(ty_op.operand);
......@@ -3463,16 +3438,12 @@ const DeclGen = struct {
34633438 }
34643439
34653440 fn airIntFromPtr(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3466 if (self.liveness.isUnused(inst)) return null;
3467
34683441 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
34693442 const operand_id = try self.resolve(un_op);
34703443 return try self.intFromPtr(operand_id);
34713444 }
34723445
34733446 fn airFloatFromInt(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3474 if (self.liveness.isUnused(inst)) return null;
3475
34763447 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
34773448 const operand_ty = self.typeOf(ty_op.operand);
34783449 const operand_id = try self.resolve(ty_op.operand);
......@@ -3497,8 +3468,6 @@ const DeclGen = struct {
34973468 }
34983469
34993470 fn airIntFromFloat(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3500 if (self.liveness.isUnused(inst)) return null;
3501
35023471 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
35033472 const operand_id = try self.resolve(ty_op.operand);
35043473 const dest_ty = self.typeOfIndex(inst);
......@@ -3522,8 +3491,6 @@ const DeclGen = struct {
35223491 }
35233492
35243493 fn airIntFromBool(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3525 if (self.liveness.isUnused(inst)) return null;
3526
35273494 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
35283495 const operand_id = try self.resolve(un_op);
35293496 const result_ty = self.typeOfIndex(inst);
......@@ -3538,8 +3505,6 @@ const DeclGen = struct {
35383505 }
35393506
35403507 fn airFloatCast(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3541 if (self.liveness.isUnused(inst)) return null;
3542
35433508 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
35443509 const operand_id = try self.resolve(ty_op.operand);
35453510 const dest_ty = self.typeOfIndex(inst);
......@@ -3555,7 +3520,6 @@ const DeclGen = struct {
35553520 }
35563521
35573522 fn airNot(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3558 if (self.liveness.isUnused(inst)) return null;
35593523 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
35603524 const operand_id = try self.resolve(ty_op.operand);
35613525 const result_ty = self.typeOfIndex(inst);
......@@ -3587,8 +3551,6 @@ const DeclGen = struct {
35873551 }
35883552
35893553 fn airArrayToSlice(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3590 if (self.liveness.isUnused(inst)) return null;
3591
35923554 const mod = self.module;
35933555 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
35943556 const array_ptr_ty = self.typeOf(ty_op.operand);
......@@ -3613,8 +3575,6 @@ const DeclGen = struct {
36133575 }
36143576
36153577 fn airSlice(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3616 if (self.liveness.isUnused(inst)) return null;
3617
36183578 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
36193579 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
36203580 const ptr_id = try self.resolve(bin_op.lhs);
......@@ -3627,8 +3587,6 @@ const DeclGen = struct {
36273587 }
36283588
36293589 fn airAggregateInit(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3630 if (self.liveness.isUnused(inst)) return null;
3631
36323590 const mod = self.module;
36333591 const ip = &mod.intern_pool;
36343592 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
......@@ -3681,9 +3639,9 @@ const DeclGen = struct {
36813639 const elem_ids = try self.gpa.alloc(IdRef, n_elems);
36823640 defer self.gpa.free(elem_ids);
36833641
3684 for (elements, elem_ids) |element, *elem_id| {
3642 for (elements, 0..) |element, i| {
36853643 const id = try self.resolve(element);
3686 elem_id.* = try self.convertToIndirect(result_ty.childType(mod), id);
3644 elem_ids[i] = try self.convertToIndirect(result_ty.childType(mod), id);
36873645 }
36883646
36893647 return try self.constructComposite(result_ty, elem_ids);
......@@ -3694,9 +3652,9 @@ const DeclGen = struct {
36943652 const elem_ids = try self.gpa.alloc(IdRef, n_elems);
36953653 defer self.gpa.free(elem_ids);
36963654
3697 for (elements, elem_ids) |element, *elem_id| {
3655 for (elements, 0..) |element, i| {
36983656 const id = try self.resolve(element);
3699 elem_id.* = try self.convertToIndirect(array_info.elem_type, id);
3657 elem_ids[i] = try self.convertToIndirect(array_info.elem_type, id);
37003658 }
37013659
37023660 if (array_info.sentinel) |sentinel_val| {
......@@ -3750,7 +3708,6 @@ const DeclGen = struct {
37503708 }
37513709
37523710 fn airSliceField(self: *DeclGen, inst: Air.Inst.Index, field: u32) !?IdRef {
3753 if (self.liveness.isUnused(inst)) return null;
37543711 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
37553712 const field_ty = self.typeOfIndex(inst);
37563713 const operand_id = try self.resolve(ty_op.operand);
......@@ -3807,8 +3764,6 @@ const DeclGen = struct {
38073764 }
38083765
38093766 fn airPtrElemPtr(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3810 if (self.liveness.isUnused(inst)) return null;
3811
38123767 const mod = self.module;
38133768 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
38143769 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
......@@ -3826,8 +3781,6 @@ const DeclGen = struct {
38263781 }
38273782
38283783 fn airArrayElemVal(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3829 if (self.liveness.isUnused(inst)) return null;
3830
38313784 const mod = self.module;
38323785 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
38333786 const array_ty = self.typeOf(bin_op.lhs);
......@@ -3848,8 +3801,6 @@ const DeclGen = struct {
38483801 }
38493802
38503803 fn airPtrElemVal(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3851 if (self.liveness.isUnused(inst)) return null;
3852
38533804 const mod = self.module;
38543805 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
38553806 const ptr_ty = self.typeOf(bin_op.lhs);
......@@ -3906,8 +3857,6 @@ const DeclGen = struct {
39063857 }
39073858
39083859 fn airGetUnionTag(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3909 if (self.liveness.isUnused(inst)) return null;
3910
39113860 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
39123861 const un_ty = self.typeOf(ty_op.operand);
39133862
......@@ -3991,8 +3940,6 @@ const DeclGen = struct {
39913940 }
39923941
39933942 fn airUnionInit(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
3994 if (self.liveness.isUnused(inst)) return null;
3995
39963943 const mod = self.module;
39973944 const ip = &mod.intern_pool;
39983945 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
......@@ -4009,8 +3956,6 @@ const DeclGen = struct {
40093956 }
40103957
40113958 fn airStructFieldVal(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4012 if (self.liveness.isUnused(inst)) return null;
4013
40143959 const mod = self.module;
40153960 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
40163961 const struct_field = self.air.extraData(Air.StructField, ty_pl.payload).data;
......@@ -4131,7 +4076,6 @@ const DeclGen = struct {
41314076 }
41324077
41334078 fn airStructFieldPtrIndex(self: *DeclGen, inst: Air.Inst.Index, field_index: u32) !?IdRef {
4134 if (self.liveness.isUnused(inst)) return null;
41354079 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
41364080 const struct_ptr = try self.resolve(ty_op.operand);
41374081 const struct_ptr_ty = self.typeOf(ty_op.operand);
......@@ -4185,7 +4129,6 @@ const DeclGen = struct {
41854129 }
41864130
41874131 fn airAlloc(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4188 if (self.liveness.isUnused(inst)) return null;
41894132 const mod = self.module;
41904133 const ptr_ty = self.typeOfIndex(inst);
41914134 assert(ptr_ty.ptrAddressSpace(mod) == .generic);
......@@ -4769,9 +4712,7 @@ const DeclGen = struct {
47694712
47704713 try self.beginSpvBlock(ok_block);
47714714 }
4772 if (self.liveness.isUnused(inst)) {
4773 return null;
4774 }
4715
47754716 if (!eu_layout.payload_has_bits) {
47764717 return null;
47774718 }
......@@ -4781,8 +4722,6 @@ const DeclGen = struct {
47814722 }
47824723
47834724 fn airErrUnionErr(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4784 if (self.liveness.isUnused(inst)) return null;
4785
47864725 const mod = self.module;
47874726 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
47884727 const operand_id = try self.resolve(ty_op.operand);
......@@ -4806,8 +4745,6 @@ const DeclGen = struct {
48064745 }
48074746
48084747 fn airErrUnionPayload(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4809 if (self.liveness.isUnused(inst)) return null;
4810
48114748 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
48124749 const operand_id = try self.resolve(ty_op.operand);
48134750 const payload_ty = self.typeOfIndex(inst);
......@@ -4821,8 +4758,6 @@ const DeclGen = struct {
48214758 }
48224759
48234760 fn airWrapErrUnionErr(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4824 if (self.liveness.isUnused(inst)) return null;
4825
48264761 const mod = self.module;
48274762 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
48284763 const err_union_ty = self.typeOfIndex(inst);
......@@ -4844,8 +4779,6 @@ const DeclGen = struct {
48444779 }
48454780
48464781 fn airWrapErrUnionPayload(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4847 if (self.liveness.isUnused(inst)) return null;
4848
48494782 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
48504783 const err_union_ty = self.typeOfIndex(inst);
48514784 const operand_id = try self.resolve(ty_op.operand);
......@@ -4865,8 +4798,6 @@ const DeclGen = struct {
48654798 }
48664799
48674800 fn airIsNull(self: *DeclGen, inst: Air.Inst.Index, is_pointer: bool, pred: enum { is_null, is_non_null }) !?IdRef {
4868 if (self.liveness.isUnused(inst)) return null;
4869
48704801 const mod = self.module;
48714802 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
48724803 const operand_id = try self.resolve(un_op);
......@@ -4939,8 +4870,6 @@ const DeclGen = struct {
49394870 }
49404871
49414872 fn airIsErr(self: *DeclGen, inst: Air.Inst.Index, pred: enum { is_err, is_non_err }) !?IdRef {
4942 if (self.liveness.isUnused(inst)) return null;
4943
49444873 const mod = self.module;
49454874 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
49464875 const operand_id = try self.resolve(un_op);
......@@ -4975,8 +4904,6 @@ const DeclGen = struct {
49754904 }
49764905
49774906 fn airUnwrapOptional(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4978 if (self.liveness.isUnused(inst)) return null;
4979
49804907 const mod = self.module;
49814908 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
49824909 const operand_id = try self.resolve(ty_op.operand);
......@@ -4993,8 +4920,6 @@ const DeclGen = struct {
49934920 }
49944921
49954922 fn airUnwrapOptionalPtr(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
4996 if (self.liveness.isUnused(inst)) return null;
4997
49984923 const mod = self.module;
49994924 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
50004925 const operand_id = try self.resolve(ty_op.operand);
......@@ -5019,8 +4944,6 @@ const DeclGen = struct {
50194944 }
50204945
50214946 fn airWrapOptional(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
5022 if (self.liveness.isUnused(inst)) return null;
5023
50244947 const mod = self.module;
50254948 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
50264949 const payload_ty = self.typeOf(ty_op.operand);