Commit 78c94665 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[wasm][turbofan] Introduce size limit for loop peeling

Not peeling very large loops gives speedups on some benchmarks.

Change-Id: Ifbdf08ddaee0e9c638238a6bcf4a3a5ea319b817
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3660243
Auto-Submit: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80699}
parent 132cee6f
......@@ -1712,7 +1712,7 @@ struct WasmLoopPeelingPhase {
if (loop_info.can_be_innermost) {
ZoneUnorderedSet<Node*>* loop =
LoopFinder::FindSmallInnermostLoopFromHeader(
loop_info.header, temp_zone, std::numeric_limits<size_t>::max(),
loop_info.header, temp_zone, FLAG_wasm_loop_peeling_max_size,
false);
if (loop == nullptr) continue;
PeelWasmLoop(loop_info.header, loop, data->graph(), data->common(),
......
......@@ -1134,6 +1134,7 @@ DEFINE_NEG_IMPLICATION(liftoff_only, wasm_speculative_inlining)
DEFINE_BOOL(wasm_loop_unrolling, true,
"enable loop unrolling for wasm functions")
DEFINE_BOOL(wasm_loop_peeling, false, "enable loop peeling for wasm functions")
DEFINE_SIZE_T(wasm_loop_peeling_max_size, 1000, "maximum size for peeling")
DEFINE_BOOL(wasm_fuzzer_gen_test, false,
"generate a test case when running a wasm fuzzer")
DEFINE_IMPLICATION(wasm_fuzzer_gen_test, single_threaded)
......
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