Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: no hole in liveranges for pinned vreg move src. #60

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/ion/liveranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ impl<'a, F: Function> Env<'a, F> {
src.vreg(),
OperandKind::Def,
OperandPos::Late,
ProgPoint::after(inst),
ProgPoint::before(inst),
)
} else {
// Dest is pinned: this is a use on the src with a pinned preg.
Expand Down Expand Up @@ -681,18 +681,22 @@ impl<'a, F: Function> Env<'a, F> {
if live.get(pinned_vreg.vreg()) {
let pinned_lr = vreg_ranges[pinned_vreg.vreg()];
let orig_start = self.ranges[pinned_lr.index()].range.from;
// Following instruction start
// (so we don't transition in
// middle of inst).
let new_start = ProgPoint::before(progpoint.inst().next());
trace!(
" -> live with LR {:?}; truncating to start at {:?}",
pinned_lr,
progpoint.next()
new_start,
);
self.ranges[pinned_lr.index()].range.from =
progpoint.next();
self.ranges[pinned_lr.index()].range.from = new_start;

let new_lr = self.add_liverange_to_vreg(
VRegIndex::new(pinned_vreg.vreg()),
CodeRange {
from: orig_start,
to: progpoint.prev(),
to: progpoint,
},
);
vreg_ranges[pinned_vreg.vreg()] = new_lr;
Expand Down Expand Up @@ -725,7 +729,7 @@ impl<'a, F: Function> Env<'a, F> {
VRegIndex::new(pinned_vreg.vreg()),
CodeRange {
from: self.cfginfo.block_entry[block.index()],
to: ProgPoint::before(inst),
to: progpoint,
},
);
vreg_ranges[pinned_vreg.vreg()] = new_lr;
Expand Down