Skip to content

Commit

Permalink
Stop moving fixed reg operands to after if there is a clobber or late…
Browse files Browse the repository at this point in the history
… fixed def of the same PReg.
  • Loading branch information
Iizerd committed Sep 6, 2024
1 parent ab3c0a4 commit f9bdffc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ion/liveranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,17 @@ impl<'a, F: Function> Env<'a, F> {
if !reused_inputs.is_empty()
&& !reused_inputs.contains(&operand.vreg()) =>
{
ProgPoint::after(inst)
if let OperandConstraint::FixedReg(preg) = operand.constraint() {
if self.func.inst_clobbers(inst).contains(preg)
|| late_def_fixed.contains(&preg)
{
ProgPoint::before(inst)
} else {
ProgPoint::after(inst)
}
} else {
ProgPoint::after(inst)
}
}
(OperandKind::Use, OperandPos::Early) => ProgPoint::before(inst),
};
Expand Down

0 comments on commit f9bdffc

Please sign in to comment.