Commit f18d7e82 authored by fpizlo@apple.com's avatar fpizlo@apple.com

DFG misses some obvious opportunities for common subexpression elimination

https://bugs.webkit.org/show_bug.cgi?id=69233

Reviewed by Oliver Hunt.
        
0.7% speed-up on SunSpider.

* dfg/DFGPropagator.cpp:
(JSC::DFG::Propagator::getByValLoadElimination):
(JSC::DFG::Propagator::getMethodLoadElimination):
(JSC::DFG::Propagator::checkStructureLoadElimination):
(JSC::DFG::Propagator::getByOffsetLoadElimination):
(JSC::DFG::Propagator::getPropertyStorageLoadElimination):
(JSC::DFG::Propagator::performNodeCSE):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a3b8aadb
2011-10-02 Filip Pizlo <fpizlo@apple.com>
DFG misses some obvious opportunities for common subexpression elimination
https://bugs.webkit.org/show_bug.cgi?id=69233
Reviewed by Oliver Hunt.
0.7% speed-up on SunSpider.
* dfg/DFGPropagator.cpp:
(JSC::DFG::Propagator::getByValLoadElimination):
(JSC::DFG::Propagator::getMethodLoadElimination):
(JSC::DFG::Propagator::checkStructureLoadElimination):
(JSC::DFG::Propagator::getByOffsetLoadElimination):
(JSC::DFG::Propagator::getPropertyStorageLoadElimination):
(JSC::DFG::Propagator::performNodeCSE):
2011-10-02 Gavin Barraclough <barraclough@apple.com>
Bug 67455 - Different regular expression result
......@@ -964,11 +964,18 @@ private:
if (node.child1() == child1 && canonicalize(node.child2()) == canonicalize(child2))
return node.child3();
break;
case PutStructure:
case PutByOffset:
// GetByVal currently always speculates that it's accessing an
// array with an integer index, which means that it's impossible
// for a structure change or a put to property storage to affect
// the GetByVal.
break;
default:
if (clobbersWorld(index))
return NoNode;
break;
}
if (clobbersWorld(index))
break;
}
return NoNode;
}
......@@ -978,13 +985,30 @@ private:
NodeIndex start = startIndexForChildren(child1);
for (NodeIndex index = m_compileIndex; index-- > start;) {
Node& node = m_graph[index];
if (node.op == CheckMethod
&& node.child1() == child1
&& node.identifierNumber() == identifierNumber
&& m_graph.m_methodCheckData[node.methodCheckDataIndex()] == methodCheckData)
return index;
if (clobbersWorld(index))
switch (node.op) {
case CheckMethod:
if (node.child1() == child1
&& node.identifierNumber() == identifierNumber
&& m_graph.m_methodCheckData[node.methodCheckDataIndex()] == methodCheckData)
return index;
break;
case PutByOffset:
// If a put was optimized to by-offset then it's not changing the structure
break;
case PutByVal:
case PutByValAlias:
// PutByVal currently always speculates that it's accessing an array with an
// integer index, which means that it's impossible for it to cause a structure
// change.
break;
default:
if (clobbersWorld(index))
return NoNode;
break;
}
}
return NoNode;
}
......@@ -1011,6 +1035,13 @@ private:
// Setting a property cannot change the structure.
break;
case PutByVal:
case PutByValAlias:
// PutByVal currently always speculates that it's accessing an array with an
// integer index, which means that it's impossible for it to cause a structure
// change.
break;
default:
if (clobbersWorld(index))
return false;
......@@ -1044,6 +1075,13 @@ private:
// Changing the structure cannot change the outcome of a property get.
break;
case PutByVal:
case PutByValAlias:
// PutByVal currently always speculates that it's accessing an array with an
// integer index, which means that it's impossible for it to cause a structure
// change.
break;
default:
if (clobbersWorld(index))
return NoNode;
......@@ -1070,6 +1108,13 @@ private:
// change the property storage pointer.
break;
case PutByVal:
case PutByValAlias:
// PutByVal currently always speculates that it's accessing an array with an
// integer index, which means that it's impossible for it to cause a structure
// change.
break;
default:
if (clobbersWorld(index))
return NoNode;
......@@ -1191,11 +1236,14 @@ private:
case ArithMax:
case ArithSqrt:
case GetCallee:
case GetArrayLength:
case GetStringLength:
setReplacement(pureCSE(node));
break;
case GetArrayLength:
setReplacement(impureCSE(node));
break;
case GetScopeChain:
setReplacement(getScopeChainLoadElimination(node.scopeChainDepth()));
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment