Commit abb7cdc9 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

[regalloc] Loop-top values can be backedges too

When counting which backedges conflict with a loop-top phi value, we
should include values introduced at the start of the loop.

I don't expect this change to make performance differences on its own,
but it is a step toward changing the heuristic so that we're less likely
to introduce unnecessary load/store pairs across the backedge.

Bug: v8:10606
Change-Id: I299e388b0b964573119ba0b775d50f398c467c46
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2385715Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#69752}
parent 3219b29d
......@@ -2789,9 +2789,9 @@ void BundleBuilder::BuildBundles() {
if (out->TryMerge(input_bundle, data()->is_trace_alloc())) {
TRACE("Merged %d and %d to %d\n", phi->virtual_register(), input,
out->id());
} else if (input_range->Start() > out_range->Start()) {
// We are only interested in values defined after the phi, because
// those are values that will go over a back-edge.
} else if (input_range->Start() >= out_range->Start()) {
// We are only interested in values defined at or after the phi,
// because those are values that will go over a back-edge.
phi_interferes_with_backedge_input = true;
}
} else {
......@@ -2799,9 +2799,9 @@ void BundleBuilder::BuildBundles() {
if (out->TryAddRange(input_range)) {
TRACE("Added %d and %d to %d\n", phi->virtual_register(), input,
out->id());
} else if (input_range->Start() > out_range->Start()) {
// We are only interested in values defined after the phi, because
// those are values that will go over a back-edge.
} else if (input_range->Start() >= out_range->Start()) {
// We are only interested in values defined at or after the phi,
// because those are values that will go over a back-edge.
phi_interferes_with_backedge_input = true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment