Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9bcfc6eb9f1504539c3be7638d739c0047a2802c
https://github.com/WebKit/WebKit/commit/9bcfc6eb9f1504539c3be7638d739c0047a2802c
Author: Yijia Huang <[email protected]>
Date: 2025-05-08 (Thu, 08 May 2025)
Changed paths:
M Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp
M Source/JavaScriptCore/runtime/OptionsList.h
Log Message:
-----------
[JSC] Add numeric hot loop unrolling pattern
https://bugs.webkit.org/show_bug.cgi?id=292521
rdar://150660479
Reviewed by Yusuke Suzuki.
This patch introduces a specialized unrolling pattern for "numeric hot loops" —
loops
that are dominated by numeric computation and local variable access, and which
are not
expected to be inlined due to their size.
Key changes:
- Introduced a new unrolling heuristic for loops where:
- Only one non-pad block exists in the loop,
- More than 30% of material nodes are numeric computation nodes,
- More than 40% are local access nodes,
- The material node count is between 160 and 225.
Since FTL inlining is governed by the total function size
(`maximumFunctionForCallInlineCandidateBytecodeCostForFTL`, currently 170),
loops with body sizes above 160 are unlikely to be inlined. Therefore, unrolling
them doesn't harm inlining decisions but may still yield performance benefits.
Additional changes:
- Added `isNumericComputationNode()` and `isLocalAccessNode()` helpers.
- Introduced `MaxNumericHotLoopSize = 225` as the special-case upper bound.
- Refactored `maxAllowedUnrollSize()` to reflect both general and special-case
limits.
- Ensured early bailout during loop scanning uses the updated size limit.
This change improves performance on tight computational loops that were
previously
skipped due to general unroll thresholds, while avoiding regressions in code
size
sensitive scenarios.
Canonical link: https://commits.webkit.org/294683@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes