Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1eb0a4145815a064b8a169090b5ee50d3d2b72ac
      
https://github.com/WebKit/WebKit/commit/1eb0a4145815a064b8a169090b5ee50d3d2b72ac
  Author: Yijia Huang <yijia_hu...@apple.com>
  Date:   2025-04-11 (Fri, 11 Apr 2025)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp

  Log Message:
  -----------
  [JSC] DFGLoopUnrollingPhase: Enforce tail and exit block unification for safe 
unrolling
https://bugs.webkit.org/show_bug.cgi?id=291393
rdar://149023954

Reviewed by Yusuke Suzuki.

This patch tightens the eligibility criteria for loop unrolling by requiring
that the loop tail (block that branches back to the header) and the loop exit
block (block that exits the loop) must be the same.

This restriction ensures the loop follows a simple and well-structured control
flow pattern, making it safe for full unrolling without introducing correctness
issues or complex edge handling.

Specifically:
1. Identifies the tail block by looking for a unique predecessor of the header 
that dominates it.
2. Identifies the exit block as a loop body block with a successor outside the 
loop.
3. Skips unrolling if multiple tails, multiple exits, or mismatched tail and 
exit blocks are found.

This change is a preparatory step for broader loop unrolling support in the 
future.

* Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp:
(JSC::DFG::LoopUnrollingPhase::locateTail):

Canonical link: https://commits.webkit.org/293588@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to