Changeset 4090 in CLRX


Ignore:
Timestamp:
May 6, 2018, 4:10:15 PM (2 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: preps to creating livenesses with routines (add callStack to createLivenesses).
Remove isRoutineGen bitset from createSSAData.

Location:
CLRadeonExtender/trunk/amdasm
Files:
3 edited

Legend:

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

    r4089 r4090  
    12981298   
    12991299    // construct vreg liveness
     1300    std::deque<CallStackEntry2> callStack;
    13001301    std::deque<FlowStackEntry3> flowStack;
    13011302    std::vector<bool> visited(codeBlocks.size(), false);
    13021303    // hold last vreg ssaId and position
    13031304    LastVRegMap lastVRegMap;
     1305   
     1306    std::unordered_map<size_t, RoutineDataLv> routineMap;
    13041307   
    13051308    // key - current res first key, value - previous first key and its flowStack pos
     
    14581461            }
    14591462        }
     1463       
     1464        if (!callStack.empty() &&
     1465            entry.blockIndex == callStack.back().callBlock &&
     1466            entry.nextIndex-1 == callStack.back().callNextIndex)
     1467        {
     1468            ARDOut << " ret: " << entry.blockIndex << "\n";
     1469            callStack.pop_back(); // just return from call
     1470        }
     1471       
    14601472        if (entry.nextIndex < cblock.nexts.size())
    14611473        {
     1474            bool isCall = false;
     1475            size_t nextBlock = cblock.nexts[entry.nextIndex].block;
     1476            if (cblock.nexts[entry.nextIndex].isCall)
     1477            {
     1478                callStack.push_back({ entry.blockIndex, entry.nextIndex, nextBlock });
     1479                isCall = true;
     1480            }
     1481           
    14621482            flowStack.push_back({ cblock.nexts[entry.nextIndex].block, 0 });
    14631483            entry.nextIndex++;
  • CLRadeonExtender/trunk/amdasm/AsmRegAlloc.h

    r4088 r4090  
    176176    std::unordered_map<BlockIndex, LoopSSAIdMap> loopEnds;
    177177    bool notFirstReturn;
     178    bool generated;
    178179    size_t weight_;
    179180   
    180     RoutineData() : notFirstReturn(false), weight_(0)
     181    RoutineData() : notFirstReturn(false), generated(false), weight_(0)
    181182    { }
    182183   
     
    239240    size_t callNextIndex; // index of call next
    240241    BlockIndex routineBlock;    // routine block
     242};
     243
     244struct CLRX_INTERNAL CallStackEntry2
     245{
     246    size_t callBlock; // index
     247    size_t callNextIndex; // index of call next
     248    size_t routineBlock;    // routine block
    241249};
    242250
  • CLRadeonExtender/trunk/amdasm/AsmRegAllocSSAData.cpp

    r4082 r4090  
    14831483    // to track ways last block indices pair: block index, flowStackPos)
    14841484    std::pair<size_t, size_t> lastCommonCacheWayPoint{ SIZE_MAX, SIZE_MAX };
    1485     CBlockBitPool isRoutineGen(codeBlocks.size(), false);
    14861485   
    14871486    CBlockBitPool waysToCache(codeBlocks.size(), false);
     
    16111610            const BlockIndex routineBlock = callStack.back().routineBlock;
    16121611            RoutineData& prevRdata = routineMap.find(routineBlock)->second;
    1613             if (!isRoutineGen[routineBlock])
     1612            if (!prevRdata.generated)
    16141613            {
    16151614                createRoutineData(codeBlocks, curSSAIdMap, loopBlocks, callBlocks,
    16161615                            cblocksToCache, subroutinesCache, routineMap, prevRdata,
    16171616                            routineBlock, prevCallFlowStackBlocks, callFlowStackBlocks);
    1618                 isRoutineGen[routineBlock] = true;
     1617                prevRdata.generated = true;
    16191618               
    16201619                auto csimsmit = curSSAIdMapStateMap.find(routineBlock.index);
Note: See TracChangeset for help on using the changeset viewer.