Changeset 3942 in CLRX


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

CLRadeonExtender: AsmRegAlloc?: Yet another update.

File:
1 edited

Legend:

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

    r3941 r3942  
    15891589        std::unordered_map<AsmSingleVReg, size_t>& curSSAIdMap,
    15901590        const std::unordered_set<size_t>& loopBlocks,
     1591        const std::unordered_set<size_t>& recurBlocks,
    15911592        const ResSecondPointsToCache& subroutToCache,
    15921593        SimpleCache<size_t, RoutineData>& subroutinesCache,
     
    16381639            const bool oldFB = flowStackBlocks[entry.blockIndex];
    16391640            flowStackBlocks[entry.blockIndex] = !oldFB;
    1640             createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, subroutToCache,
    1641                     subroutinesCache, routineMap, routineMapRecur, subrData,
    1642                     entry.blockIndex, true, flowStackBlocks);
     1641            createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, recurBlocks,
     1642                    subroutToCache, subroutinesCache, routineMap, routineMapRecur,
     1643                    subrData, entry.blockIndex, true, flowStackBlocks);
    16431644            RoutineData subrDataCopy;
    16441645            flowStackBlocks[entry.blockIndex] = oldFB;
     
    18251826        for (; entry.nextIndex < cblock.nexts.size() &&
    18261827                    cblock.nexts[entry.nextIndex].isCall; entry.nextIndex++)
     1828        {
     1829            const size_t nextRBlock = cblock.nexts[entry.nextIndex].block;
     1830            if (recurBlocks.find(nextRBlock) != recurBlocks.end())
     1831            {
     1832                std::cout << "-- crd recurBlock store ppoint: " << nextRBlock
     1833                        << std::endl;
     1834                continue;
     1835            }
     1836           
    18271837            //joinRoutineData(rdata, routineMap.find(
    18281838            //                cblock.nexts[entry.nextIndex].block)->second);
    1829             joinRoutineData(rdata, *findRoutine(routineMap, routineMapRecur,
    1830                             cblock.nexts[entry.nextIndex].block));
     1839            joinRoutineData(rdata, *findRoutine(routineMap, routineMapRecur, nextRBlock));
     1840        }
    18311841       
    18321842        if (entry.nextIndex < cblock.nexts.size())
     
    19111921           
    19121922            if ((!noMainLoop || flowStack.size() > 1) &&
    1913                 subroutToCache.count(entry.blockIndex)!=0)
     1923                subroutToCache.count(entry.blockIndex)!=0 &&
     1924                recurBlocks.find(entry.blockIndex) == recurBlocks.end())
    19141925            { //put to cache
    19151926                std::cout << "-- subrcache for " << entry.blockIndex << std::endl;
     
    19821993            if (!isRoutineGen[routineBlock])
    19831994            {
    1984                 createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, cblocksToCache,
    1985                         subroutinesCache, routineMap, &routineMapSP, prevRdata,
    1986                         routineBlock);
     1995                createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, recurseBlocks,
     1996                        cblocksToCache, subroutinesCache, routineMap, &routineMapSP,
     1997                        prevRdata, routineBlock);
    19871998                //prevRdata.compare(myRoutineData);
    19881999                isRoutineGen[routineBlock] = true;
     
    20642075   
    20652076    RoutineData& prevRdata = routineMapSP.find(recurBlock)->second;
    2066     createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, cblocksToCache,
     2077    createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, recurseBlocks, cblocksToCache,
    20672078                        subroutinesCache, routineMap, &routineMapSP, prevRdata,
    20682079                        recurBlock);
     
    22732284                            ssaReplacesMap, routineBlock);*/
    22742285                recurStateMap.insert({ routineBlock, { curSSAIdMap, retSSAIdMap } });
    2275                 recurseBlocks.erase(routineBlock);
    22762286            }
    22772287            else if (!isRoutineGen[routineBlock])
    22782288            {
    2279                 createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, cblocksToCache,
    2280                         subroutinesCache, routineMap, nullptr, prevRdata, routineBlock);
     2289                createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, recurseBlocks,
     2290                        cblocksToCache, subroutinesCache, routineMap, nullptr,
     2291                        prevRdata, routineBlock);
    22812292                //prevRdata.compare(myRoutineData);
    22822293                isRoutineGen[routineBlock] = true;
     
    23532364                auto rsit = recurStateMap.find(entry.blockIndex);
    23542365                if (rsit != recurStateMap.end())
     2366                {
    23552367                    // second pass through recursion
    23562368                    passSecondRecurPass(codeBlocks, rsit->second.curSSAIdMap,
    23572369                            cblocksToCache, loopBlocks, recurseBlocks, routineMap,
    23582370                            rsit->second.retSSAIdMap, ssaReplacesMap, entry.blockIndex);
     2371                    recurseBlocks.erase(entry.blockIndex);
     2372                }
    23592373            }
    23602374           
Note: See TracChangeset for help on using the changeset viewer.