Commit 91062a4f authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[maglev] Fix fast compare if accumulator live range ends on branch test

Allow fast branches in the case the accumulator's live range doesn't
extend beyond the branch test. Previously we were more restrictive and
only allowed fast branches the test itself didn't use the accumulator
register.

Bug: v8:7700
Change-Id: Iec98028b3ddb04eeb51e98436a0bdc48f22920ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3663744Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80819}
parent 66a9c1c5
......@@ -431,12 +431,10 @@ bool MaglevGraphBuilder::TryBuildCompareOperationBranch(Operation operation,
case interpreter::Bytecode::kJumpIfToBooleanFalseConstant:
// This jump must kill the accumulator, otherwise we need to
// materialize the actual boolean value.
if (GetOutLiveness()->AccumulatorIsLive()) return false;
if (GetOutLivenessFor(next_offset())->AccumulatorIsLive()) return false;
// Advance the iterator past the test to the jump, skipping
// emitting the test.
iterator_.Advance();
true_offset = next_offset();
false_offset = iterator_.GetJumpTargetOffset();
break;
......@@ -446,16 +444,13 @@ bool MaglevGraphBuilder::TryBuildCompareOperationBranch(Operation operation,
case interpreter::Bytecode::kJumpIfToBooleanTrueConstant:
// This jump must kill the accumulator, otherwise we need to
// materialize the actual boolean value.
if (GetOutLiveness()->AccumulatorIsLive()) return false;
if (GetOutLivenessFor(next_offset())->AccumulatorIsLive()) return false;
// Advance the iterator past the test to the jump, skipping
// emitting the test.
iterator_.Advance();
true_offset = iterator_.GetJumpTargetOffset();
false_offset = next_offset();
break;
default:
return false;
}
......
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