[BigInt] We should enable CSE into arithmetic operations that speculate BigIntUse
authorticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 12:12:37 +0000 (12:12 +0000)
committerticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 12:12:37 +0000 (12:12 +0000)
commit1b83d3626fab48d54dcb065e0475f232b60fd6da
tree82616f17f40ff064be0fd95f0d06c5f831c85b0f
parent151cd1c99ab19be8e8a34232c11f63d77c45fe1b
[BigInt] We should enable CSE into arithmetic operations that speculate BigIntUse
https://bugs.webkit.org/show_bug.cgi?id=192723

Reviewed by Saam Barati.

PerformanceTests:

* BigIntBench/big-int-cse.js: Added.
* BigIntBench/big-int-global-cse.js: Added.
* BigIntBench/big-int-licm.js: Added.

Source/JavaScriptCore:

This patch is adjusting clobberize rules into ValueOp nodes to enable
more optimizations when we speculate BigIntUse. In such case, DFG now
is able to apply CSE, LICM and commutativity on nodes like
ValueAdd(BigInt, BigInt), ValueSub(BigInt, BigInt), etc.

Here are the numbers we can observe with some microbenchmarks:

                          baseline                 changes

big-int-cse           108.2733+-0.8445    ^    80.9897+-4.9781   ^ definitely 1.3369x faster
big-int-licm          75.6641+-0.3477     ^    57.8144+-1.6043   ^ definitely 1.3087x faster
big-int-global-cse    145.3557+-1.0552    ^    86.5866+-0.3025   ^ definitely 1.6787x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/BigIntBench/big-int-cse.js [new file with mode: 0644]
PerformanceTests/BigIntBench/big-int-global-cse.js [new file with mode: 0644]
PerformanceTests/BigIntBench/big-int-licm.js [new file with mode: 0644]
PerformanceTests/ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGClobberize.h
Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp