Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2497606

Browse files
mralephcommit-bot@chromium.org
authored andcommitted
[vm/compiler] Avoid redundant spilling of SIMD values.
There was a code in the register allocator that recognized whether destination is a spill slot or not by checking if it is one of different location types. By accident QuadSpillSlot was missing from that list - and as a result we were emitting redundant moves when connecting split siblings after register allocation. Change the code to just ask parent live which spill slot it was assigned and use that to drive decisions. dart-lang/sdk#41805 Change-Id: I73e208acd0bf86dceeaad970b8e5cbcb9c3f8eaa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147550 Reviewed-by: Daco Harkes <[email protected]> Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Vyacheslav Egorov <[email protected]>
1 parent 2018436 commit 2497606

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

runtime/vm/compiler/backend/linearscan.cc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,12 +2722,7 @@ void FlowGraphAllocator::AllocateUnallocatedRanges() {
27222722

27232723
bool FlowGraphAllocator::TargetLocationIsSpillSlot(LiveRange* range,
27242724
Location target) {
2725-
if (target.IsStackSlot() || target.IsDoubleStackSlot() ||
2726-
target.IsConstant()) {
2727-
ASSERT(GetLiveRange(range->vreg())->spill_slot().Equals(target));
2728-
return true;
2729-
}
2730-
return false;
2725+
return GetLiveRange(range->vreg())->spill_slot().Equals(target);
27312726
}
27322727

27332728
void FlowGraphAllocator::ConnectSplitSiblings(LiveRange* parent,
@@ -2843,11 +2838,7 @@ void FlowGraphAllocator::ResolveControlFlow() {
28432838
// this will cause spilling to occur on the fast path (at the definition).
28442839
for (intptr_t i = 0; i < spilled_.length(); i++) {
28452840
LiveRange* range = spilled_[i];
2846-
if (range->assigned_location().IsStackSlot() ||
2847-
range->assigned_location().IsDoubleStackSlot() ||
2848-
range->assigned_location().IsConstant()) {
2849-
ASSERT(range->assigned_location().Equals(range->spill_slot()));
2850-
} else {
2841+
if (!range->assigned_location().Equals(range->spill_slot())) {
28512842
AddMoveAt(range->Start() + 1, range->spill_slot(),
28522843
range->assigned_location());
28532844
}

0 commit comments

Comments
 (0)