Commit 3017f895 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

Revert "[regalloc] Run SpillPlacer on any value defined in a loop"

This reverts commit 7f054679.

Reason for revert: regressions on Emscripten/Fannkuch and
JetStream/richards

Original change's description:
> [regalloc] Run SpillPlacer on any value defined in a loop
> 
> I previously wrote a comment that said "We haven't seen any indication
> of performance improvements from seeking optimal spilling positions
> except on loop-top phi values". That statement is no longer true, now
> that I've looked a little harder. In the latest version of the Mono
> interpreter, we can improve performance by 2.5% by enabling SpillPlacer
> for any value defined within a loop.
> 
> Bug: v8:10606
> Change-Id: I25e06458c87ad4ffcefe52be3042032e05a47b35
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381557
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#69646}

TBR=rmcilroy@chromium.org,seth.brenith@microsoft.com,thibaudm@chromium.org

Change-Id: Ic3e74485f42bafedfe1890c0be32a29c3455afe5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10606, chromium:1124028
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388745Reviewed-by: 's avatarSeth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#69658}
parent d77e016e
......@@ -1430,7 +1430,6 @@ class V8_EXPORT_PRIVATE InstructionBlock final
return loop_end_;
}
inline bool IsLoopHeader() const { return loop_end_.IsValid(); }
bool IsInLoop() const { return IsLoopHeader() || loop_header().IsValid(); }
inline bool IsSwitchTarget() const { return switch_target_; }
inline bool ShouldAlign() const { return alignment_; }
......
......@@ -40,12 +40,12 @@ void SpillPlacer::Add(TopLevelLiveRange* range) {
// the earliest deferred block as the insertion point would cause
// incorrect behavior, so the value must be spilled at the definition.
// - We haven't seen any indication of performance improvements from seeking
// optimal spilling positions for values defined outside loops, so spill
// those values at the definition to avoid increasing the code size for no
// benefit.
// optimal spilling positions except on loop-top phi values, so spill
// any value that isn't a loop-top phi at the definition to avoid
// increasing the code size for no benefit.
if (range->GetSpillMoveInsertionLocations(data()) == nullptr ||
range->spilled() || top_start_block->IsDeferred() ||
(!FLAG_stress_turbo_late_spilling && !top_start_block->IsInLoop())) {
(!FLAG_stress_turbo_late_spilling && !range->is_loop_phi())) {
range->CommitSpillMoves(data(), spill_operand);
return;
}
......
......@@ -562,7 +562,7 @@ DEFINE_BOOL(turbo_control_flow_aware_allocation, true,
"consider control flow while allocating registers")
DEFINE_BOOL(
stress_turbo_late_spilling, false,
"optimize placement of all spill instructions, not just loop values")
"optimize placement of all spill instructions, not just loop-top phis")
DEFINE_STRING(turbo_filter, "*", "optimization filter for TurboFan compiler")
DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR")
......
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