Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3cded5952709c2ca6085385defbdafb85a4df3e0
https://github.com/WebKit/WebKit/commit/3cded5952709c2ca6085385defbdafb85a4df3e0
Author: Yusuke Suzuki <[email protected]>
Date: 2026-06-17 (Wed, 17 Jun 2026)
Changed paths:
M Source/JavaScriptCore/b3/B3EliminateCommonSubexpressions.cpp
M Source/JavaScriptCore/b3/B3Generate.cpp
M Source/JavaScriptCore/b3/B3PureCSE.cpp
M Source/JavaScriptCore/b3/B3SSACalculator.cpp
M Source/JavaScriptCore/b3/B3SSACalculator.h
M Source/JavaScriptCore/b3/testb3.h
M Source/JavaScriptCore/b3/testb3_3.cpp
Log Message:
-----------
[JSC][B3] Implement CSE without using B3::Variable
https://bugs.webkit.org/show_bug.cgi?id=317099
rdar://179662935
Reviewed by Yijia Huang.
This patch removes B3::Variable use in B3 CSE phase. This resolves
long-standing FIXME in this phase, using SSA Calculator directly instead
of B3 Variable.
The mapping is simple.
1. And "Get" and "Set" defines a new SSA Variable for each set of them.
And we Def and Use the variable. Def is corresponding to "Set" and
Use is corresponding to "Get".
2. Instead of emitting "Get", we emit a placeholder. Which will be later
replaced with the actually resolved value.
3. At the finalization, we compute SSA. This produces where we should
insert Phis. And inserting Phis to them. Also, insert Upsilon where
we need to insert. That's aligned to B3 FixSSA phase.
4. Finally, placeholder inserted in (2) is replaced with the resolved
value, which can be a direct value, or phi inserted in (3).
* Source/JavaScriptCore/b3/B3EliminateCommonSubexpressions.cpp:
* Source/JavaScriptCore/b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* Source/JavaScriptCore/b3/B3PureCSE.cpp:
(JSC::B3::PureCSE::process):
* Source/JavaScriptCore/b3/B3SSACalculator.cpp:
* Source/JavaScriptCore/b3/B3SSACalculator.h:
* Source/JavaScriptCore/b3/testb3.h:
* Source/JavaScriptCore/b3/testb3_3.cpp:
(testCSELoadAfterStoreDiamond):
(testCSELoadAcrossLoopBackEdge):
(testCSELoopHeaderLoadFromBackEdgeStore):
(addShrTests):
Canonical link: https://commits.webkit.org/315406@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications