CBE and LLVM: handle unused try instructions
In both backends they did not observe the Liveness information for try instructions. Now they do. For the C backend this is necessary for correctness; for the LLVM backend, it improves code generation.
This commit is contained in:
@@ -4092,9 +4092,14 @@ fn lowerTry(
|
||||
}
|
||||
}
|
||||
|
||||
try reap(f, inst, &.{operand});
|
||||
|
||||
if (f.liveness.isUnused(inst)) {
|
||||
return CValue.none;
|
||||
}
|
||||
|
||||
const target = f.object.dg.module.getTarget();
|
||||
const is_array = lowersToArray(payload_ty, target);
|
||||
try reap(f, inst, &.{operand});
|
||||
const local = try f.allocLocal(inst, result_ty);
|
||||
if (is_array) {
|
||||
try writer.writeAll("memcpy(");
|
||||
|
||||
Reference in New Issue
Block a user