Commit 49079f7d authored by fpizlo@apple.com's avatar fpizlo@apple.com

CSE should work in SSA

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

Reviewed by Oliver Hunt and Mark Hahnenberg.

* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::run):
(JSC::DFG::CSEPhase::performNodeCSE):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a401857
2013-12-08 Filip Pizlo <fpizlo@apple.com>
CSE should work in SSA
https://bugs.webkit.org/show_bug.cgi?id=125430
Reviewed by Oliver Hunt and Mark Hahnenberg.
* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::run):
(JSC::DFG::CSEPhase::performNodeCSE):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
2013-12-09 Joseph Pecoraro <pecoraro@apple.com> 2013-12-09 Joseph Pecoraro <pecoraro@apple.com>
Remove docs/make-bytecode-docs.pl Remove docs/make-bytecode-docs.pl
......
...@@ -48,15 +48,21 @@ public: ...@@ -48,15 +48,21 @@ public:
bool run() bool run()
{ {
ASSERT((cseMode == NormalCSE) == (m_graph.m_fixpointState == FixpointNotConverged));
ASSERT(m_graph.m_fixpointState != BeforeFixpoint); ASSERT(m_graph.m_fixpointState != BeforeFixpoint);
m_changed = false; m_changed = false;
m_graph.clearReplacements(); m_graph.clearReplacements();
if (m_graph.m_form == SSA) {
Vector<BasicBlock*> depthFirst;
m_graph.getBlocksInDepthFirstOrder(depthFirst);
for (unsigned i = 0; i < depthFirst.size(); ++i)
performBlockCSE(depthFirst[i]);
} else {
for (unsigned blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) for (unsigned blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex)
performBlockCSE(m_graph.block(blockIndex)); performBlockCSE(m_graph.block(blockIndex));
}
return m_changed; return m_changed;
} }
...@@ -1015,8 +1021,10 @@ private: ...@@ -1015,8 +1021,10 @@ private:
if (cseMode == NormalCSE) if (cseMode == NormalCSE)
m_graph.performSubstitution(node); m_graph.performSubstitution(node);
if (node->op() == SetLocal) if (node->containsMovHint()) {
ASSERT(node->op() != ZombieHint);
node->child1()->mergeFlags(NodeRelevantToOSR); node->child1()->mergeFlags(NodeRelevantToOSR);
}
switch (node->op()) { switch (node->op()) {
...@@ -1120,6 +1128,11 @@ private: ...@@ -1120,6 +1128,11 @@ private:
} }
case Flush: { case Flush: {
if (m_graph.m_form == SSA) {
// FIXME: Enable Flush store elimination in SSA form.
// https://bugs.webkit.org/show_bug.cgi?id=125429
break;
}
VariableAccessData* variableAccessData = node->variableAccessData(); VariableAccessData* variableAccessData = node->variableAccessData();
VirtualRegister local = variableAccessData->local(); VirtualRegister local = variableAccessData->local();
Node* replacement = node->child1().node(); Node* replacement = node->child1().node();
......
...@@ -269,6 +269,7 @@ Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState) ...@@ -269,6 +269,7 @@ Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState)
performLivenessAnalysis(dfg); performLivenessAnalysis(dfg);
performCFA(dfg); performCFA(dfg);
performLICM(dfg); performLICM(dfg);
performCSE(dfg);
performLivenessAnalysis(dfg); performLivenessAnalysis(dfg);
performCFA(dfg); performCFA(dfg);
if (Options::validateFTLOSRExitLiveness()) if (Options::validateFTLOSRExitLiveness())
......
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