Skip to content

Commit

Permalink
B3::ReduceStrength is overly conservative at applying specializeSelect
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270577
rdar://124146878

Reviewed by Justin Michaud.

Right now it only applies if both outputs from a select are constant. The comment
and testing indicates this is profitable as long as one of the two outputs is a constant.
This looks like a 1.7% speedup on JS3.

* Source/JavaScriptCore/b3/B3ReduceStrength.cpp:

Canonical link: https://commits.webkit.org/275765@main
  • Loading branch information
kmiller68 authored and Constellation committed Mar 6, 2024
1 parent bb61554 commit 3e74b00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/b3/B3ReduceStrength.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ class ReduceStrength {
m_value->child(0), selectSpecializationBound,
[&] (Value* value) -> bool {
return value->opcode() == Select
&& (value->child(1)->isConstant() && value->child(2)->isConstant());
&& (value->child(1)->isConstant() || value->child(2)->isConstant());
});

if (select) {
Expand Down

0 comments on commit 3e74b00

Please sign in to comment.