Ignore:
Timestamp:
Dec 9, 2013, 2:02:46 PM (11 years ago)
Author:
[email protected]
Message:

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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp

    r160295 r160328  
    4949    bool run()
    5050    {
    51         ASSERT((cseMode == NormalCSE) == (m_graph.m_fixpointState == FixpointNotConverged));
    5251        ASSERT(m_graph.m_fixpointState != BeforeFixpoint);
    5352       
     
    5655        m_graph.clearReplacements();
    5756       
    58         for (unsigned blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex)
    59             performBlockCSE(m_graph.block(blockIndex));
     57        if (m_graph.m_form == SSA) {
     58            Vector<BasicBlock*> depthFirst;
     59            m_graph.getBlocksInDepthFirstOrder(depthFirst);
     60            for (unsigned i = 0; i < depthFirst.size(); ++i)
     61                performBlockCSE(depthFirst[i]);
     62        } else {
     63            for (unsigned blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex)
     64                performBlockCSE(m_graph.block(blockIndex));
     65        }
    6066       
    6167        return m_changed;
     
    10161022            m_graph.performSubstitution(node);
    10171023       
    1018         if (node->op() == SetLocal)
     1024        if (node->containsMovHint()) {
     1025            ASSERT(node->op() != ZombieHint);
    10191026            node->child1()->mergeFlags(NodeRelevantToOSR);
     1027        }
    10201028       
    10211029        switch (node->op()) {
     
    11211129           
    11221130        case Flush: {
     1131            if (m_graph.m_form == SSA) {
     1132                // FIXME: Enable Flush store elimination in SSA form.
     1133                // https://bugs.webkit.org/show_bug.cgi?id=125429
     1134                break;
     1135            }
    11231136            VariableAccessData* variableAccessData = node->variableAccessData();
    11241137            VirtualRegister local = variableAccessData->local();
Note: See TracChangeset for help on using the changeset viewer.