Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70445421ecbf658f1036527ccfb3713942494e1f
      
https://github.com/WebKit/WebKit/commit/70445421ecbf658f1036527ccfb3713942494e1f
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    A JSTests/stress/arith-div-mod-must-generate-clear.js
    M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
    M Source/JavaScriptCore/dfg/DFGIntegerRangeOptimizationPhase.cpp
    M Source/JavaScriptCore/dfg/DFGMayExit.cpp
    M Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp

  Log Message:
  -----------
  [JSC] Remove MustGenerate from Int32Use / DoubleRepUse ArithDiv / ArithMod
https://bugs.webkit.org/show_bug.cgi?id=314596
rdar://176834546

Reviewed by Yijia Huang.

Remove MustGenerate from ArithDiv / ArithMod when they have Int32Use / 
DoubleRepUse.
They are OSR exit checks, not an error. If nobody is using the output of
these nodes (this of-course includes that no MovHint use too), removing them is
totally fine. Only problematic case is these checks are leveraged as an input
constraint in integer-range-optimization phase. We explicitly state this
condition in that phase.

We also add some strength-reduction: if RHS constant is neither 0 nor -1, we 
never overflow.
So we remove CheckOverflow flag.

Test: JSTests/stress/arith-div-mod-must-generate-clear.js
* JSTests/stress/arith-div-mod-must-generate-clear.js: Added.
(assertEq):
(divUnusedResult):
(modUnusedResult):
(modInt52Unused):
(divDoubleUnused):
(modDoubleUnused):
(const.sideEffectOperand.valueOf):
(divWithSideEffectOperand):
(modPow2InCheckOverflow):
(modPow2PreservesNegZero):
(modNonPow2):
(rangeOptArrayMod):
(storeModUnused):
(sharedMod):
(nestedModPow2):
(ftlHotMod):
(i.ftlResult.ftlHotMod):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupArithDivInt32):
(JSC::DFG::FixupPhase::fixupArithDiv):
(JSC::DFG::FixupPhase::fixupArithMul):
* Source/JavaScriptCore/dfg/DFGIntegerRangeOptimizationPhase.cpp:
* Source/JavaScriptCore/dfg/DFGMayExit.cpp:
* Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):

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



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

Reply via email to