| ... | @@ -2001,7 +2001,7 @@ fn airRetLoad(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -2001,7 +2001,7 @@ fn airRetLoad(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 2001 | | 2001 | |
| 2002 | try func.restoreStackPointer(); | 2002 | try func.restoreStackPointer(); |
| 2003 | try func.addTag(.@"return"); | 2003 | try func.addTag(.@"return"); |
| 2004 | return func.finishAir(inst, .none, &.{}); | 2004 | return func.finishAir(inst, .none, &.{un_op}); |
| 2005 | } | 2005 | } |
| 2006 | | 2006 | |
| 2007 | fn airCall(func: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.Modifier) InnerError!void { | 2007 | fn airCall(func: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.Modifier) InnerError!void { |
| ... | @@ -3161,7 +3161,7 @@ fn airBitcast(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3161,7 +3161,7 @@ fn airBitcast(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3161 | } | 3161 | } |
| 3162 | break :result func.reuseOperand(ty_op.operand, operand); | 3162 | break :result func.reuseOperand(ty_op.operand, operand); |
| 3163 | } else WValue{ .none = {} }; | 3163 | } else WValue{ .none = {} }; |
| 3164 | func.finishAir(inst, result, &.{}); | 3164 | func.finishAir(inst, result, &.{ty_op.operand}); |
| 3165 | } | 3165 | } |
| 3166 | | 3166 | |
| 3167 | fn bitcast(func: *CodeGen, wanted_ty: Type, given_ty: Type, operand: WValue) InnerError!WValue { | 3167 | fn bitcast(func: *CodeGen, wanted_ty: Type, given_ty: Type, operand: WValue) InnerError!WValue { |
| ... | @@ -4115,7 +4115,7 @@ fn airMemset(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4115,7 +4115,7 @@ fn airMemset(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4115 | const len = try func.resolveInst(bin_op.rhs); | 4115 | const len = try func.resolveInst(bin_op.rhs); |
| 4116 | try func.memset(ptr, len, value); | 4116 | try func.memset(ptr, len, value); |
| 4117 | | 4117 | |
| 4118 | func.finishAir(inst, .none, &.{pl_op.operand}); | 4118 | func.finishAir(inst, .none, &.{ pl_op.operand, bin_op.lhs, bin_op.rhs }); |
| 4119 | } | 4119 | } |
| 4120 | | 4120 | |
| 4121 | /// Sets a region of memory at `ptr` to the value of `value` | 4121 | /// Sets a region of memory at `ptr` to the value of `value` |
| ... | @@ -4424,6 +4424,7 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4424,6 +4424,7 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4424 | else => unreachable, | 4424 | else => unreachable, |
| 4425 | } | 4425 | } |
| 4426 | }; | 4426 | }; |
| | 4427 | // TODO: this is incorrect Liveness handling code |
| 4427 | func.finishAir(inst, result, &.{}); | 4428 | func.finishAir(inst, result, &.{}); |
| 4428 | } | 4429 | } |
| 4429 | | 4430 | |
| ... | @@ -4747,7 +4748,7 @@ fn airMemcpy(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4747,7 +4748,7 @@ fn airMemcpy(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4747 | const len = try func.resolveInst(bin_op.rhs); | 4748 | const len = try func.resolveInst(bin_op.rhs); |
| 4748 | try func.memcpy(dst, src, len); | 4749 | try func.memcpy(dst, src, len); |
| 4749 | | 4750 | |
| 4750 | func.finishAir(inst, .none, &.{pl_op.operand}); | 4751 | func.finishAir(inst, .none, &.{ pl_op.operand, bin_op.lhs, bin_op.rhs }); |
| 4751 | } | 4752 | } |
| 4752 | | 4753 | |
| 4753 | fn airPopcount(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | 4754 | fn airPopcount(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| ... | @@ -5158,7 +5159,8 @@ fn airMaxMin(func: *CodeGen, inst: Air.Inst.Index, op: enum { max, min }) InnerE | ... | @@ -5158,7 +5159,8 @@ fn airMaxMin(func: *CodeGen, inst: Air.Inst.Index, op: enum { max, min }) InnerE |
| 5158 | fn airMulAdd(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | 5159 | fn airMulAdd(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5159 | const pl_op = func.air.instructions.items(.data)[inst].pl_op; | 5160 | const pl_op = func.air.instructions.items(.data)[inst].pl_op; |
| 5160 | const bin_op = func.air.extraData(Air.Bin, pl_op.payload).data; | 5161 | const bin_op = func.air.extraData(Air.Bin, pl_op.payload).data; |
| 5161 | if (func.liveness.isUnused(inst)) return func.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs }); | 5162 | if (func.liveness.isUnused(inst)) |
| | 5163 | return func.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs, pl_op.operand }); |
| 5162 | | 5164 | |
| 5163 | const ty = func.air.typeOfIndex(inst); | 5165 | const ty = func.air.typeOfIndex(inst); |
| 5164 | if (ty.zigTypeTag() == .Vector) { | 5166 | if (ty.zigTypeTag() == .Vector) { |
| ... | @@ -5186,7 +5188,7 @@ fn airMulAdd(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -5186,7 +5188,7 @@ fn airMulAdd(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5186 | break :result try (try func.binOp(mul_result, addend, ty, .add)).toLocal(func, ty); | 5188 | break :result try (try func.binOp(mul_result, addend, ty, .add)).toLocal(func, ty); |
| 5187 | }; | 5189 | }; |
| 5188 | | 5190 | |
| 5189 | func.finishAir(inst, result, &.{ bin_op.lhs, bin_op.rhs }); | 5191 | func.finishAir(inst, result, &.{ bin_op.lhs, bin_op.rhs, pl_op.operand }); |
| 5190 | } | 5192 | } |
| 5191 | | 5193 | |
| 5192 | fn airClz(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | 5194 | fn airClz(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |