- 07 Apr, 2022 2 commits
-
-
Jakob Kummerow authored
The key idea is that we can now use call count feedback into account consistently for all kinds of calls that support inlining. Bug: v8:12166 Change-Id: I764b8686b6c825a9b24f0032e81f7d1217ef1371 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574554Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Manos Koukoutos <manoskouk@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#79861}
-
Jakob Kummerow authored
This adds feedback collection to count the number of executions of call_direct instructions in Liftoff code. The purpose is better inlining decisions in Turbofan, which are enabled by having call count information for all kinds of calls. The new feature is gated on --wasm-speculative-inlining. While direct calls don't need to speculate about their target, the whole feedback collection infrastructure depends on that flag. Bug: v8:12166 Change-Id: Ie24a988fcea631f370188dc21e60a5fac923dd3d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571807Reviewed-by: Manos Koukoutos <manoskouk@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#79846}
-
- 16 Dec, 2021 1 commit
-
-
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: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org> Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Cr-Commit-Position: refs/heads/main@{#78394}
-
- 24 Nov, 2021 1 commit
-
-
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: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Cr-Commit-Position: refs/heads/main@{#78068}
-
- 18 Oct, 2021 1 commit
-
-
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: Nico Hartmann <nicohartmann@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Cr-Commit-Position: refs/heads/main@{#77428}
-
- 07 Oct, 2021 1 commit
-
-
Jakob Kummerow authored
This patch adds infrastructure for collecting feedback about call_ref call targets in Liftoff code, and using that feedback for turning such calls into inlineable direct calls when building Turbofan graphs. The feature is considered experimental quality and hence off by default, --wasm-speculative-inlining turns it on. Bug: v8:7748 Change-Id: I0d0d776f8a71c3dd2c9124d3731f3cb06d4f5821 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3205902 Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/main@{#77287}
-
- 14 Sep, 2021 2 commits
-
-
Manos Koukoutos authored
We introduce the WasmInliningHeuristics virtual class and implement it with a trivial heuristics that inlines direct calls based on callee index only. Other, more meaningful heuristics will be introduced later. Bug: v8:12166 Change-Id: I74fd8f61e0c97b975827fa062629e9ff7463e058 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3157952 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#76816}
-
Manos Koukoutos authored
Bug: v8:12166 Change-Id: Ic15170b6e2dbaf5c9218c8fd951f4f7462b1d37a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3157951 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#76810}
-
- 13 Sep, 2021 2 commits
-
-
Manos Koukoutos authored
Bug: v8:12166 Change-Id: I4e9322ff5289cc76b4434b200f9369d9231e5bc8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3145416 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/main@{#76792}
-
Manos Koukoutos authored
Bug: v8:12166 Change-Id: If77ecea8102e4ba5d98d3e1e6700e9c1efaa319a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3144913 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/main@{#76787}
-
- 07 Sep, 2021 1 commit
-
-
Manos Koukoutos authored
We introduce basic wasm inlining infrastructure behind a flag. The implementation is currently incomplete. Additionally, we always inline the function at index 0; proper inlining heuristics will be added later. Changes: - Rename WasmInliningPhase -> JSWasmInliningPhase - Introduce WasmInliningPhase and WasmInliner. - Pass additional parameters as needed to GenerateCodeForWasmFunction. - Remove EnsureEnd in WasmGraphAssembler. Create end node at the start of compilation. - Add a simple test. Bug: v8:12166 Change-Id: Ifd7006ba378e9f74cd248b71e16869fbbb8a82be Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141575 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/main@{#76689}
-