Skip to content

Commit

Permalink
Don't assume a write if an operand is not in function parameters
Browse files Browse the repository at this point in the history
Liveness assumes that if the operand is not in the parameters of
a function call it is being written to, resulting in pointless memcpies.
  • Loading branch information
favre49 authored and andrewrk committed Jan 24, 2024
1 parent eff58d6 commit 2ab7893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Liveness.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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;
Expand Down

0 comments on commit 2ab7893

Please sign in to comment.