Changeset 3939 in CLRX


Ignore:
Timestamp:
Mar 26, 2018, 1:26:31 PM (4 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: Preliminary enabled recursion support in the code (untested).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/AsmRegAlloc.cpp

    r3938 r3939  
    19271927
    19281928static void passSecondRecurPass(const std::vector<CodeBlock>& codeBlocks,
     1929            std::unordered_map<AsmSingleVReg, size_t>& curSSAIdMap,
    19291930            const ResSecondPointsToCache& cblocksToCache,
    19301931            const std::unordered_set<size_t>& loopBlocks,
    19311932            const std::unordered_set<size_t>& recurseBlocks,
    1932             const std::unordered_map<size_t, RoutineData>& routineMap,
     1933            std::unordered_map<size_t, RoutineData>& routineMap,
    19331934            RetSSAIdMap& retSSAIdMap, SSAReplacesMap& ssaReplacesMap,
    19341935            size_t recurBlock)
    19351936{
    1936     std::unordered_map<AsmSingleVReg, size_t> curSSAIdMap;
    19371937    SimpleCache<size_t, RoutineData> subroutinesCache(codeBlocks.size()<<3);
    19381938   
     
    19451945    flowStack.push_back({ recurBlock, 0 });
    19461946   
     1947    callStack.push_back({ SIZE_MAX, 0, recurBlock });
     1948    routineMapSP.insert({ recurBlock, { } });
     1949   
    19471950    while (!flowStack.empty())
    19481951    {
     
    19911994        if (entry.nextIndex < cblock.nexts.size())
    19921995        {
    1993             bool isCall = false;
    19941996            const size_t nextBlock = cblock.nexts[entry.nextIndex].block;
    19951997            if (cblock.nexts[entry.nextIndex].isCall)
     
    20042006                else
    20052007                    std::cout << "   -- recursion: " << nextBlock << std::endl;
    2006                 isCall = true;
    20072008            }
    20082009            entry.nextIndex++;
     
    20592060        }
    20602061    }
     2062   
     2063    // replace routineMap entries by routineMapSP entries
     2064    for (const auto& entry: routineMapSP)
     2065        routineMap[entry.first] = entry.second;
    20612066}
    20622067
     
    22692274                    recurseBlocks.insert(nextBlock);
    22702275                    std::cout << "   -- recursion: " << nextBlock << std::endl;
     2276                    passSecondRecurPass(codeBlocks, curSSAIdMap, cblocksToCache,
     2277                            loopBlocks, recurseBlocks, routineMap, retSSAIdMap,
     2278                            ssaReplacesMap, nextBlock);
    22712279                }
    22722280               
Note: See TracChangeset for help on using the changeset viewer.