Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b16849008e438b42d44b16e43da8b99c0796cf87
      
https://github.com/WebKit/WebKit/commit/b16849008e438b42d44b16e43da8b99c0796cf87
  Author: Yijia Huang <[email protected]>
  Date:   2025-03-25 (Tue, 25 Mar 2025)

  Changed paths:
    A JSTests/stress/loop-unrolling-variable.js
    M Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp
    M Source/JavaScriptCore/runtime/OptionsList.h

  Log Message:
  -----------
  [JSC] DFGLoopUnrollingPhase: Support partial loop unrolling for non-constant 
bounds
https://bugs.webkit.org/show_bug.cgi?id=290335
rdar://147775029

Reviewed by Yusuke Suzuki.

This patch enhances the DFG loop unrolling phase to support partial unrolling
for loops with non-constant bounds. Previously, loop unrolling was limited to
loops with statically known iteration counts. Now, loops with dynamic operands
can be unrolled partially based on new thresholds. And this version offers:

                                             without                     with

loop-unrolling-variable-medium            7.3285+-0.0263     !      
7.4737+-0.0300        ! definitely 1.0198x slower
loop-unrolling-variable                   0.3481+-0.0077            
0.3477+-0.0082
loop-unrolling-variable-medium-dep       28.6089+-0.5330     ^     
10.9441+-0.0331        ^ definitely 2.6141x faster
loop-unrolling-variable-large            66.6766+-0.0446     !     
66.8410+-0.0559        ! definitely 1.0025x slower
loop-unrolling-variable-small             0.6056+-0.0088            
0.6029+-0.0092

Currently, partial loop unrolling is disabled and it would be reenabled once
the heuristics tuning is done.

* JSTests/stress/loop-unrolling-partial.js: Added.
(func1):
(test):
* Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp:
(JSC::DFG::LoopUnrollingPhase::LoopData::isOperandConstant const):
(JSC::DFG::LoopUnrollingPhase::run):
(JSC::DFG::LoopUnrollingPhase::tryUnroll):
(JSC::DFG::LoopUnrollingPhase::identifyInductionVariable):
(JSC::DFG::LoopUnrollingPhase::shouldUnrollLoop):
(JSC::DFG::LoopUnrollingPhase::unrollLoop):
(JSC::DFG::LoopUnrollingPhase::LoopData::dump const):
* Source/JavaScriptCore/runtime/OptionsList.h:

Canonical link: https://commits.webkit.org/292691@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

Reply via email to