Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a5fa580c849f0d81096e8650be79392ae1517f59
      
https://github.com/WebKit/WebKit/commit/a5fa580c849f0d81096e8650be79392ae1517f59
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-08-19 (Wed, 19 Aug 2026)

  Changed paths:
    A JSTests/wasm/stress/licm-trapping-load-in-try.js
    M Source/JavaScriptCore/b3/B3Effects.h
    M Source/JavaScriptCore/b3/B3HoistLoopInvariantValues.cpp
    M Source/JavaScriptCore/b3/testb3.h
    M Source/JavaScriptCore/b3/testb3_1.cpp
    M Source/JavaScriptCore/b3/testb3_7.cpp

  Log Message:
  -----------
  [JSC] B3::hoistLoopInvariantValues should be better at handling interference 
between control dependence and side exits
https://bugs.webkit.org/show_bug.cgi?id=174763
rdar://185360182

Reviewed by Keith Miller.

This patch extends B3's LICM to handle trapping loads. Currently we were
really conservative: we gave up when the value traps. But we can handle
these control-dependent trapping loads,

1. Since we are already ensuring that pre-header is backward-dominated
   by the current block, this ensures that when value is executed,
   pre-header must be executed before as well.
2. If we do not find any different traps between the pre-header and this
   value in the current block, then this trap is the first one. Hoisting
   it to the pre-header and trapping early is totally fine since there
   is no other traps we may observe first.

Test: JSTests/wasm/stress/licm-trapping-load-in-try.js

* JSTests/wasm/stress/licm-trapping-load-in-try.js: Added.
(async test):
* Source/JavaScriptCore/b3/B3Effects.h:
(JSC::B3::Effects::isWrite const):
(JSC::B3::Effects::isTrapBarrier const):
(JSC::B3::Effects::mustExecute const):
* Source/JavaScriptCore/b3/B3HoistLoopInvariantValues.cpp:
(JSC::B3::isTrappingLoad):
(JSC::B3::isReachedWithoutTrapBarrier):
(JSC::B3::hoistLoopInvariantValues):
* Source/JavaScriptCore/b3/testb3.h:
* Source/JavaScriptCore/b3/testb3_1.cpp:
(run):
* Source/JavaScriptCore/b3/testb3_7.cpp:
(testLICMControlDependentSideExitInPredecessor):
(testLICMControlDependentSideExitInEarlierIteration):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to