[webkit-changes] [WebKit/WebKit] 63b6c4: Allow using callee-save registers when WASM SIMD i...

Justin Michaud noreply at github.com
Tue Jan 10 17:29:17 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 63b6c42ff2b8191437f4257dd5ca251d91851d80
      https://github.com/WebKit/WebKit/commit/63b6c42ff2b8191437f4257dd5ca251d91851d80
  Author: Justin Michaud <justin at justinmichaud.com>
  Date:   2023-01-10 (Tue, 10 Jan 2023)

  Changed paths:
    A JSTests/microbenchmarks/exceptions-simd-float.wasm
    A JSTests/microbenchmarks/exceptions-simd-float.wat
    A JSTests/microbenchmarks/exceptions-simd.js
    A JSTests/microbenchmarks/exceptions-simd.wasm
    A JSTests/microbenchmarks/exceptions-simd.wat
    M JSTests/wasm/v8/graceful_shutdown.js
    M JSTests/wasm/v8/import-function.js
    M JSTests/wasm/v8/many-modules.js
    M JSTests/wasm/v8/regress/regress-9017.js
    M Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp
    M Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackByLinearScan.cpp
    M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
    M Source/JavaScriptCore/b3/air/AirCode.cpp
    M Source/JavaScriptCore/b3/air/AirCustom.cpp
    M Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp
    M Source/JavaScriptCore/b3/air/AirGenerate.cpp
    M Source/JavaScriptCore/b3/air/AirHandleCalleeSaves.cpp
    M Source/JavaScriptCore/b3/air/AirInstInlines.h
    M Source/JavaScriptCore/b3/air/AirLogRegisterPressure.cpp
    M Source/JavaScriptCore/b3/air/AirLowerAfterRegAlloc.cpp
    M Source/JavaScriptCore/jit/RegisterSet.cpp
    M Source/JavaScriptCore/jit/RegisterSet.h
    M Source/JavaScriptCore/jit/Width.h
    M Source/JavaScriptCore/wasm/WasmAirIRGenerator64.cpp
    M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
    M Source/JavaScriptCore/wasm/WasmIRGeneratorHelpers.h

  Log Message:
  -----------
  Allow using callee-save registers when WASM SIMD is enabled
https://bugs.webkit.org/show_bug.cgi?id=250151
rdar://103929372

Reviewed by Michael Saboff.

When a function allocates a vector tmp in an FP calle-save register (ARM64 only),
it must treat the top half of that register as volatile. To work around
a bug, we currently avoid using those registers at all.

1) Fix a bug caused by an incorrect rebase that claimed that we did not clobber
fp callee-saves at all when SIMD is used in a function.

2) Avoid using linear scan with SIMD. It is not optimal and barely tested.

3) Ensure that patchpoints correctly claim that they only clobber the top
of callee-save fp registers.

4) Fix some minor assertion failures and noisy test output.

5) Add a microbenchmark to prove that SIMD still regresses OSR

6) Through manual inspection, verify that we can now generate the following code:

Patch &Patchpoint0, %x0, %q8 b at 16

instead of

MoveFloat %q8, -44(%fp), b at 11
Patch &Patchpoint0, %x0, -44(%fp), b at 16

iff %q8 is not used as a vector.

* JSTests/wasm/v8/graceful_shutdown.js:
(CompileFunctionsTest):
* JSTests/wasm/v8/import-function.js:
(testCallPrint.fakePrint):
(testCallPrint):
* JSTests/wasm/v8/many-modules.js:
* Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
(JSC::B3::Air::allocateRegistersAndStackByLinearScan):
* Source/JavaScriptCore/b3/air/AirCode.cpp:
(JSC::B3::Air::Code::Code):
* Source/JavaScriptCore/b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* Source/JavaScriptCore/b3/air/AirLowerAfterRegAlloc.cpp:
(JSC::B3::Air::lowerAfterRegAlloc):
* Source/JavaScriptCore/b3/air/AirTmpWidth.cpp:
(JSC::B3::Air::TmpWidth::recompute):
* Source/JavaScriptCore/jit/RegisterSet.h:
* Source/JavaScriptCore/wasm/WasmAirIRGenerator64.cpp:
(JSC::Wasm::AirIRGenerator64::emitCatchImpl):
(JSC::Wasm::AirIRGenerator64::addThrow):
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::finalizeEntrypoints):
(JSC::Wasm::ExpressionType>::addLoop):
* Source/JavaScriptCore/wasm/WasmIRGeneratorHelpers.h:
(JSC::Wasm::emitCatchPrologueShared):

Canonical link: https://commits.webkit.org/258757@main




More information about the webkit-changes mailing list