Commit 38bcad20 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[maglev] Fix double register merging

DoubleRegister RegisterMerge could get assigned a Tagged representation
operand if the node in the merge was null.

Also, we had a wrong DCHECK when materialising these moves, as a result
of templatifying the gap move implementation.

Bug: v8:7700
Change-Id: I2a425a6bedf4c67e8acf6c30c877e055b6445b12
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3783994
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82018}
parent 4946e5d9
......@@ -273,7 +273,6 @@ class MaglevCodeGeneratingNodeProcessor {
RegisterT target_reg,
RegisterMovesT<RegisterT>& register_moves,
RegisterReloadsT<RegisterT>& register_reloads) {
DCHECK(!source.IsDoubleRegister());
if (source.IsAnyRegister()) {
// For reg->reg moves, don't emit the move yet, but instead record the
// move in the set of parallel register moves, to be resolved later.
......
......@@ -1493,9 +1493,12 @@ void StraightForwardRegisterAllocator::MergeRegisterValues(ControlNode* control,
RegisterMerge* merge;
LoadMergeState(state, &node, &merge);
MachineRepresentation mach_repr = node == nullptr
// This isn't quite the right machine representation for Int32 nodes, but
// those are stored in the same registers as Tagged nodes so in this case it
// doesn't matter.
MachineRepresentation mach_repr = std::is_same_v<decltype(reg), Register>
? MachineRepresentation::kTagged
: node->GetMachineRepresentation();
: MachineRepresentation::kFloat64;
compiler::AllocatedOperand register_info = {
compiler::LocationOperand::REGISTER, mach_repr, reg.code()};
......
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