Changeset 197445 in webkit
- Timestamp:
- Mar 1, 2016, 11:53:20 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGStrengthReductionPhase.cpp (modified) (2 diffs)
-
tests/stress/arith-modulo-twice.js (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r197444 r197445 1 2016-03-01 Benjamin Poulain <benjamin@webkit.org> 2 3 [JSC] Simplify ArithMod(ArithMod(x, const1), const2) if const2 >= const1 4 https://bugs.webkit.org/show_bug.cgi?id=154904 5 6 Reviewed by Saam Barati. 7 8 The ASM test "ubench" has a "x % 10 % 255". 9 The second modulo should be eliminated. 10 11 This is a 15% improvement on ASMJS' ubench. 12 13 * dfg/DFGStrengthReductionPhase.cpp: 14 (JSC::DFG::StrengthReductionPhase::handleNode): 15 * tests/stress/arith-modulo-twice.js: Added. 16 (opaqueModuloSmaller): 17 (opaqueModuloEqual): 18 (opaqueModuloLarger): 19 (opaqueModuloSmallerNeg): 20 (opaqueModuloEqualNeg): 21 (opaqueModuloLargerNeg): 22 (opaqueExpectedOther): 23 1 24 2016-03-01 Ryosuke Niwa <rniwa@webkit.org> 2 25 -
trunk/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
r197370 r197445 37 37 #include "DFGVariableAccessDataDump.h" 38 38 #include "JSCInlines.h" 39 #include <cstdlib> 39 40 40 41 namespace JSC { namespace DFG { … … 170 171 m_changed = true; 171 172 } 173 } 174 break; 175 176 case ArithMod: 177 // On Integers 178 // In: ArithMod(ArithMod(x, const1), const2) 179 // Out: Identity(ArithMod(x, const1)) 180 // if const1 <= const2. 181 if (m_node->binaryUseKind() == Int32Use 182 && m_node->child2()->isInt32Constant() 183 && m_node->child1()->op() == ArithMod 184 && m_node->child1()->binaryUseKind() == Int32Use 185 && m_node->child1()->child2()->isInt32Constant() 186 && std::abs(m_node->child1()->child2()->asInt32()) <= std::abs(m_node->child2()->asInt32())) { 187 convertToIdentityOverChild1(); 172 188 } 173 189 break;
Note:
See TracChangeset
for help on using the changeset viewer.