Changeset 4169 in CLRX


Ignore:
Timestamp:
May 15, 2018, 7:32:46 PM (7 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: Fixed creating routine data (for livenesses) for two recursion passes.

Location:
CLRadeonExtender/trunk/amdasm
Files:
2 edited

Legend:

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

    r4163 r4169  
    240240    LastAccessMap lastAccessMap;
    241241    std::unordered_set<size_t> haveReturnBlocks;
    242     bool inSecondPass;
     242    bool fromSecondPass;
    243243};
    244244
  • CLRadeonExtender/trunk/amdasm/AsmRegAllocLive.cpp

    r4167 r4169  
    921921        const std::unordered_map<size_t, VIdxSetEntry>& vidxRoutineMap,
    922922        RoutineDataLv& rdata, VIdxSetEntry& routineVIdxes,
    923         BlockIndex routineBlock, const VarIndexMap* vregIndexMaps,
     923        size_t routineBlock, const VarIndexMap* vregIndexMaps,
    924924        size_t regTypesNum, const cxuint* regRanges)
    925925{
     
    936936   
    937937    bool notFirstReturn = false;
    938     flowStack.push_back({ routineBlock.index, 0 });
     938    flowStack.push_back({ routineBlock, 0 });
    939939    RoutineCurAccessMap curSVRegMap; // key - svreg, value - block index
    940940   
     
    10161016                        cblock.nexts[entry.nextIndex].isCall; entry.nextIndex++)
    10171017            {
    1018                 BlockIndex rblock(cblock.nexts[entry.nextIndex].block, routineBlock.pass);
     1018                BlockIndex rblock = cblock.nexts[entry.nextIndex].block;
    10191019                if (rblock != routineBlock &&
    10201020                    recurseBlocks.find(rblock.index) == recurseBlocks.end())
     
    11191119    for (const AsmSingleVReg& svreg: vregsNotInAllRets)
    11201120    {
    1121         auto res = rdata.lastAccessMap.insert(
    1122                     { svreg, { { routineBlock.index, false } } });
     1121        auto res = rdata.lastAccessMap.insert({ svreg, { { routineBlock, false } } });
    11231122        if (!res.second)
    11241123        {
    11251124            VectorSet<LastAccessBlockPos>& sset = res.first->second;
    1126             sset.insertValue({ routineBlock.index, false });
     1125            sset.insertValue({ routineBlock, false });
    11271126        }
    11281127    }
     
    13801379            // later in first pass (after return from second pass)
    13811380            // we check whether second pass happened for this routine
    1382             if (res.second || res.first->second.inSecondPass)
    1383             {
    1384                 res.first->second.inSecondPass = routineBlock.pass==1;
     1381            // order: create in second pass recursion
     1382            //           (fromSecondPass && rblock.pass==0 avoids
     1383            //            doubles creating in second pass)
     1384            //        create in first pass recursion
     1385            if (res.second || (res.first->second.fromSecondPass && routineBlock.pass==0))
     1386            {
     1387                res.first->second.fromSecondPass = routineBlock.pass==1;
    13851388                auto varRes = vidxRoutineMap.insert({ routineBlock.index, VIdxSetEntry{} });
    13861389                createRoutineDataLv(codeBlocks, routineMap, recurseBlocks, vidxRoutineMap,
Note: See TracChangeset for help on using the changeset viewer.