1. 16 Dec, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm][turbofan] Inline before loop unrolling · b9855173
      Manos Koukoutos authored
      We switch the order of inlining and loop unrolling optimizations. This
      gives small improvements to wasm-gc benchmarks.
      Changes:
      - Change the loop analysis algorithm to accept loops directly connected
        to the graph's end. This is required because some nodes in an inlined
        function, such as tail calls, might be directly connected to the outer
        function's end without an intervening LoopExit node.
      - Based on the above, skip emitting loop exits for some Throw nodes in
        WasmGraphBuildingInterface.
      - Introduce WasmInliningPhase, add it before loop unrolling. Remove
        inlining from WasmOptimizationPhase.
      - Handle graph terminators in loop unrolling.
      - Add loops in the inlined function to the callers loop_infos.
      Drive-by:
      - Allow more wasm builtins in unrolled loops.
      - Reduce inlining parameters to reflect that functions are now slightly
        smaller during inlining, as no unrolling has taken place yet.
      
      Bug: v8:12166
      Change-Id: Iadd6b2f75170aa153ca1efb47fbb0d185c2b8371
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3329783Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78394}
      b9855173
  2. 14 Dec, 2021 1 commit
  3. 13 Dec, 2021 1 commit
  4. 10 Dec, 2021 1 commit
  5. 09 Dec, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm][turbofan] Immutable object operators · 4113cf64
      Manos Koukoutos authored
      Design doc: bit.ly/36MfD6Y
      
      We introduce simplified operators LoadImmutableFromObject and
      InitializeImmutableInObject. These are lowered to Loads and Stores like
      LoadFromObject and StoreToObject.
      We split CsaLoadElimination::AbstractState in two HalfStates,
      which represent the mutable and immutable component of the state.
      Immutable operators in the effect chain modify the immutable half-state,
      and plain operators modify the mutable half-state. The immutable part is
      maintained through write effects and loop headers. Immutable
      initializations do not lookup and kill previous overlapping stores,
      assuming each offset cannot be initialized more than once.
      
      Bug: v8:11510
      
      Change-Id: I0f5feca3354fdd3bdc1f511cc5214ec51e1407ad
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3268728Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78325}
      4113cf64
  6. 08 Dec, 2021 3 commits
  7. 29 Nov, 2021 3 commits
  8. 26 Nov, 2021 1 commit
  9. 24 Nov, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm] Internal representation for function references · f60132e9
      Manos Koukoutos authored
      Design doc: bit.ly/3jEVgzz
      
      We separate the internal representation of function references in Wasm
      from their JSFunction-based (external) representation. This improves
      performance of call_ref by requiring less indirections to load the
      context and call target from a function reference. In the boundary
      between wasm and JS/the C API, we add transformations between the two
      representations.
      
      Detailed changes:
      - Introduce WasmInternalFunction, containing fields required by
        call_ref, as well as a reference to the corresponding
        WasmExternalFunction. Add a reference to the WasmInternalFunction in
        WasmFunctionData. The {WasmInternalFunction::FromExternal} helper
        extracts the internal out of an external function.
      - Change {WasmInstanceObject::external_functions()} to internal
        functions.
      - Change wasm function tables to contain internal functions.
      - Change the following code to use internal functions:
        - call_ref in liftoff and Turbofan
        - function type checks in liftoff and Turbofan
        - CallRefIC and GenericJSToWasmWrapper builtins
        - {InitExprInterface::RefFunc}
        - module-compiler.cc in {ProcessTypeFeedback}
        - In module-instantiate.cc, in function-rtt creation.
      - Add transformations between internal and external functions in:
        - WasmWrapperGraphBuilder::{ToJS, BuildUnpackObjectWrapper, FromJS,
          BuildJSToJSWrapper}.
        - debug-wasm-objects.cc in {FunctionProxy::Get},
          {WasmValueObject::New} and {AddWasmTableObjectInternalProperties}.
        - runtime-wasm.cc in ReplaceWrapper
        - the C and JS APIs
        - module-instantiate.cc, in import and export processing, as well as
          {InitializeIndirectFunctionTables}
        - WasmTableObject::{IsValidElement, SetFunctionTableEntry}
        - {WasmGlobalObject::SetFuncRef}
      - Simplify body descriptors of WasmExternalFunction variants.
      - Adjust tests.
      
      Bug: v8:11510
      
      Change-Id: I8377f46f55c3771391ae1c5c8201a83854ee7878
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277878Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78068}
      f60132e9
  10. 18 Nov, 2021 1 commit
  11. 17 Nov, 2021 1 commit
  12. 15 Nov, 2021 2 commits
  13. 12 Nov, 2021 1 commit
  14. 11 Nov, 2021 1 commit
  15. 05 Nov, 2021 2 commits
  16. 04 Nov, 2021 1 commit
    • Andreas Haas's avatar
      [wasm] Do not serialize modules that don't contain TurboFan code · 272e5a87
      Andreas Haas authored
      The wasm serialization format only contains TurboFan code. All other
      functions are only represented by placeholders. With this CL
      serialization fails if the serialized module does not contain any
      TurboFan functions and would therefore consist only of placeholders.
      
      This is a defense in depth approach, because ideally serialization
      only gets triggered when TurboFan code is available. However, in some
      scenarios like debugging it can happen that modules without TurboFan
      code get serialized.
      
      Bug: v8:12281
      Change-Id: Ib05430ff89eb2317da80fc0d086ce1d7ab0e919d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3212510
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77715}
      272e5a87
  17. 26 Oct, 2021 1 commit
  18. 18 Oct, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm][turbofan] Improve inlining heuristics · bce44108
      Manos Koukoutos authored
      This CL improves wasm inlining heuristics in Turbofan, for an average
      8,5% performance improvement in selected benchmarks.
      
      Changes:
      - In WasmInliner::Reduce(), only collect inlining candidates into a
        priority queue, according to WasmInliner::LexicographicOrdering.
        Move actual inlining to Finalize().
      - Remove the InlineFirstFew heuristic. Add two limits to inlining:
        Maximum relative size increase (reversely proportional to the function
        size), and absolute size increase.
      - Pass information about call frequency from liftoff-collected feedback
        to the WasmInliner though the wasm module.
      - Run wasm inlining along other optimizations in the pipeline.
      - Split inlining and speculative inlining tests.
      
      Bug: v8:7748, v8:12166
      Change-Id: Iccee22093db765981889a24451fb458dfce1f1a6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3222764Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77428}
      bce44108
  19. 14 Oct, 2021 1 commit
  20. 04 Oct, 2021 1 commit
  21. 30 Sep, 2021 3 commits
  22. 22 Sep, 2021 1 commit
  23. 21 Sep, 2021 3 commits
  24. 20 Sep, 2021 1 commit
  25. 17 Sep, 2021 3 commits
  26. 16 Sep, 2021 3 commits