From 2ab78937dd29fbc299ac434f962a5ff41002cc43 Mon Sep 17 00:00:00 2001 From: Rahul Prabhu Date: Sun, 21 Jan 2024 22:45:03 +0530 Subject: [PATCH] Don't assume a write if an operand is not in function parameters Liveness assumes that if the operand is not in the parameters of a function call it is being written to, resulting in pointless memcpies. --- src/Liveness.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Liveness.zig b/src/Liveness.zig index 56b70be317..6227da3ede 100644 --- a/src/Liveness.zig +++ b/src/Liveness.zig @@ -489,7 +489,7 @@ pub fn categorizeOperand( for (args, 0..) |arg, i| { if (arg == operand_ref) return matchOperandSmallIndex(l, inst, @as(OperandInt, @intCast(i + 1)), .write); } - return .write; + return .none; } var bt = l.iterateBigTomb(inst); if (bt.feed()) { @@ -504,7 +504,7 @@ pub fn categorizeOperand( if (arg == operand_ref) return .write; } } - return .write; + return .none; }, .select => { const pl_op = air_datas[@intFromEnum(inst)].pl_op;