Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e87ea0e64ebffc16db63d899489458e775f3324a
      
https://github.com/WebKit/WebKit/commit/e87ea0e64ebffc16db63d899489458e775f3324a
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/b3/B3Generate.cpp
    M Source/JavaScriptCore/b3/B3PureCSE.cpp
    M Source/JavaScriptCore/b3/B3PureCSE.h
    M Source/JavaScriptCore/b3/B3ReduceDoubleToFloat.cpp
    M Source/JavaScriptCore/b3/B3ReduceStrength.cpp
    A Source/JavaScriptCore/b3/B3SpecializeSelect.cpp
    A Source/JavaScriptCore/b3/B3SpecializeSelect.h
    M Source/JavaScriptCore/b3/testb3_6.cpp
    M Source/JavaScriptCore/runtime/OptionsList.h

  Log Message:
  -----------
  [JSC] Extract specialize-select from B3::ReduceStrength
https://bugs.webkit.org/show_bug.cgi?id=324673
rdar://187939367

Reviewed by Dan Hecht.

This is one of series of patches in B3 changes. specialize-select
operation in B3::ReduceStrength is very weird: this is not a value local
operation and inserting new basic blocks. This breaks PureCSE results
(so it is removing matching values), adjusting various conditions
(m_root, etc.). This operation is not a natural fit in
B3::ReduceStrength.

This patch extracts this from B3::ReduceStrength. We define it in a
separate phase as B3SpecializeSelect. This significantly simplifies
B3::ReduceStrength, and allowing us to do further massive change in this
phase.

This conversion happens 1613 times in JetStream3, and this phase covers
1581 cases (all of conversions in ReduceStrength Initial phase, and only
missing cases happening in Final phase). And this is performance-neutral
or slightly better due to removing second iteration of ReduceStrength
(when specialize-select happens, we ran the iteration twice, costly much
more for compile time rather than the gain). So, while this is not
strictly covering all cases we had, in terms of compile time v.s.
throughput tradeoff, this is the better design.

Test: Source/JavaScriptCore/b3/testb3_6.cpp

* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* Source/JavaScriptCore/b3/B3PureCSE.cpp:
(JSC::B3::PureCSE::remove): Deleted.
* Source/JavaScriptCore/b3/B3PureCSE.h:
* Source/JavaScriptCore/b3/B3ReduceDoubleToFloat.cpp:
* Source/JavaScriptCore/b3/B3ReduceStrength.cpp:
* Source/JavaScriptCore/b3/B3SpecializeSelect.cpp: Added.
(JSC::B3::specializeSelect):
* Source/JavaScriptCore/b3/B3SpecializeSelect.h: Copied from 
Source/JavaScriptCore/b3/B3PureCSE.h.
* Source/JavaScriptCore/b3/testb3_6.cpp:
(testCheckSelectAndDeadCheckCSE):
* Source/JavaScriptCore/runtime/OptionsList.h:

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



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

Reply via email to