Skip to content

Commit 2ab7893

Browse files
favre49andrewrk
authored andcommitted
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.
1 parent eff58d6 commit 2ab7893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Liveness.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ pub fn categorizeOperand(
489489
for (args, 0..) |arg, i| {
490490
if (arg == operand_ref) return matchOperandSmallIndex(l, inst, @as(OperandInt, @intCast(i + 1)), .write);
491491
}
492-
return .write;
492+
return .none;
493493
}
494494
var bt = l.iterateBigTomb(inst);
495495
if (bt.feed()) {
@@ -504,7 +504,7 @@ pub fn categorizeOperand(
504504
if (arg == operand_ref) return .write;
505505
}
506506
}
507-
return .write;
507+
return .none;
508508
},
509509
.select => {
510510
const pl_op = air_datas[@intFromEnum(inst)].pl_op;

0 commit comments

Comments
 (0)