[turbofan] Use movl for reloading 32-bit values

This enables an optimization for JavaScript which is currently only
enabled for WebAssembly. Clusterfuzz found problems on a previous try to
enable this (see https://crbug.com/1356461), but a fix
(https://crrev.com/c/4197349) landed in the meantime which might have
fixed things.
Any resulting crashes or other issues will have to be fixed before the
v11.2 branch cut, otherwise we will have to revert this CL.

R=jkummerow@chromium.org

Bug: v8:13581
Change-Id: I139804e53285803d7f2178893c86b520c96a8eb0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4205923
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85565}
This commit is contained in:
Clemens Backes 2023-01-31 14:23:30 +01:00 committed by V8 LUCI CQ
parent 9901a04144
commit 614f62d8a1

View File

@ -5355,10 +5355,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
case MoveType::kStackToRegister: {
Operand src = g.ToOperand(source);
if (source->IsStackSlot()) {
// TODO(13581): Fix this for other code kinds (see
// https://crbug.com/1356461).
if (code_kind() == CodeKind::WASM_FUNCTION && Is32BitOperand(source) &&
Is32BitOperand(destination)) {
if (Is32BitOperand(source) && Is32BitOperand(destination)) {
// When we need only 32 bits, move only 32 bits. Benefits:
// - Save a byte here and there (depending on the destination
// register; "movl eax, ..." is smaller than "movq rax, ...").