Changeset 4167 in CLRX


Ignore:
Timestamp:
May 15, 2018, 1:23:18 PM (10 days ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: Comment code. remove obsolete a commented code.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdasm/Assembler.h

    r4133 r4167  
    323323        size_t ssaIdLast; ///< last SSA id in last
    324324        size_t ssaIdChange; ///< number of SSA id changes
    325         size_t firstPos;
    326         size_t lastPos;
     325        size_t firstPos;    ///< first position in code block (section offset)
     326        size_t lastPos;     ///< last position in code block (section offset)
    327327        bool readBeforeWrite;   ///< have read before write
    328328        SSAInfo(size_t _bssaId = SIZE_MAX, size_t _ssaIdF = SIZE_MAX,
     
    337337    {
    338338        size_t start, end; // place in code
     339        // next blocks rules:
     340        // if only one and next block have index: empty.
     341        // if have calls, then implicitly the last next block have next block index
     342        //     and it is not inserted into nexts list.
     343        // otherwise nexts list contains next blocks
    339344        std::vector<NextBlock> nexts; ///< nexts blocks, if empty then direct next block
    340         bool haveCalls;
    341         bool haveReturn;
    342         bool haveEnd;
     345        bool haveCalls; ///< code have calls at its end
     346        bool haveReturn; ///< code have return from routine
     347        bool haveEnd;   ///< code have end
    343348        // key - regvar, value - SSA info for this regvar
    344349        std::unordered_map<AsmSingleVReg, SSAInfo> ssaInfoMap;
  • CLRadeonExtender/trunk/amdasm/AsmRegAllocLive.cpp

    r4166 r4167  
    146146    size_t startSSAId = ssaId;
    147147    bool fromStartPos = false;
     148    // determine first SSAId and whether filling should begin from start of the routine
    148149    if (routineBlock == startBlock)
    149150    {
     
    243244            if (curHavePath)
    244245            {
     246                // fill up block when in path
    245247                auto sinfoIt = cblock.ssaInfoMap.find(svreg);
    246248                size_t cbStart = cblock.start;
     
    263265            // back
    264266            flowStack.pop_back();
    265             // propagate have Path
     267            // propagate havePath
    266268            if (!flowStack.empty())
    267269            {
     
    325327                    if (entry.lastAccessIndex < lastAccessIt->second.size())
    326328                    {
     329                        // we have new path in subroutine to fill
    327330                        const auto& lastAccess =
    328331                                lastAccessIt->second[entry.lastAccessIndex];
     
    446449    std::unordered_set<size_t> visited;
    447450   
     451    // already read in current path
     452    // key - vreg, value - source block where vreg of conflict found
    448453    SVRegBlockMap alreadyReadMap;
    449454    SVRegMap cacheSecPoints;
     
    509514                 !cblock.haveReturn && !cblock.haveEnd)
    510515        {
    511             // add toResolveMap ssaIds inside called routines
     516            // add alreadyReadMap ssaIds inside called routines
    512517            for (const auto& next: cblock.nexts)
    513518                if (next.isCall)
     
    625630    }
    626631   
     632    // collect previous svreg from current path
    627633    for (auto pfit = prevFlowStack.begin()+pfStartIndex; pfit != pfEnd; ++pfit)
    628634    {
     
    750756                 !cblock.haveReturn && !cblock.haveEnd)
    751757        {
    752             // add toResolveMap ssaIds inside called routines
     758            // add alreadReadMap ssaIds inside called routines
    753759            for (const auto& next: cblock.nexts)
    754760                if (next.isCall)
     
    14511457                    if (next.isCall)
    14521458                    {
    1453                         /*size_t pass = 0;
    1454                         if (callBlocks.find(next.block) != callBlocks.end())
    1455                         {
    1456                             ARDOut << " is secpass: " << entry.blockIndex << " : " <<
    1457                                     next.block << "\n";
    1458                             pass = 1; // it ways second pass
    1459                         }*/
    1460                        
    14611459                        auto rit = routineMap.find(next.block);
    14621460                        if (rit == routineMap.end())
  • CLRadeonExtender/trunk/amdasm/AsmRegAllocSSAData.cpp

    r4125 r4167  
    152152    std::unordered_set<size_t> visited;
    153153   
     154    // already read in current path
     155    // key - vreg, value - source block where vreg of conflict found
    154156    SVRegBlockMap alreadyReadMap;
    155157   
     
    322324    }
    323325   
     326    // collect previous svreg from current path
    324327    for (auto pfit = prevFlowStack.begin()+pfStartIndex; pfit != pfEnd; ++pfit)
    325328    {
     
    413416                 !cblock.haveReturn && !cblock.haveEnd)
    414417        {
    415             // add toResolveMap ssaIds inside called routines
     418            // add alreadyReadMap ssaIds inside called routines
    416419            for (const auto& next: cblock.nexts)
    417420                if (next.isCall)
     
    10941097            if (!prevFlowStackBlocks.empty() && prevFlowStackBlocks[entry.blockIndex])
    10951098            {
     1099                // if loop detected (from previous subroutine)
     1100                // handling loops inside routine
    10961101                tryAddLoopEnd(entry, routineBlock, rdata, isLoop, noMainLoop);
    10971102               
     
    14831488   
    14841489    CBlockBitPool waysToCache(codeBlocks.size(), false);
     1490    // used for detect loop code blocks (blocks where is begin loop)
    14851491    CBlockBitPool flowStackBlocks(codeBlocks.size(), false);
    14861492   
     1493    // prevCallFlowStackBlocks - is always empty for createRoutineData
    14871494    CBlockBitPool prevCallFlowStackBlocks;
     1495    // callFlowStackBlocks - flowStackBlocks from call
    14881496    CBlockBitPool callFlowStackBlocks(codeBlocks.size(), false);
    14891497    // subroutToCache - true if given block begin subroutine to cache
Note: See TracChangeset for help on using the changeset viewer.