Changeset 3963 in CLRX


Ignore:
Timestamp:
Apr 3, 2018, 5:02:43 PM (4 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: Do not revertRetSSAIdMap with routine data in the createSSAData.
Add previous SSAId to lastSSAIdMap if no ssaId added to lastSSAIdMap before joinRoutineData.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r3962 r3963  
    13161316// join routine data from child call with data from parent routine
    13171317// (just join child call from parent)
    1318 static void joinRoutineData(RoutineData& dest, const RoutineData& src)
     1318static void joinRoutineData(RoutineData& dest, const RoutineData& src,
     1319            const std::unordered_map<AsmSingleVReg, size_t>& curSSAIdMap,
     1320            bool notFirstReturn)
    13191321{
    13201322    // insert readBeforeWrite only if doesnt exists in destination
     
    13371339            for (size_t ssaId: entry.second)
    13381340                destEntry.insertValue(ssaId);
     1341        }
     1342        else if (notFirstReturn)
     1343        {
     1344            auto csit = curSSAIdMap.find(entry.first);
     1345            // insert to lastSSAIdMap if no ssaIds for regvar in lastSSAIdMap
     1346            dest.lastSSAIdMap.insert({ entry.first,
     1347                        { (csit!=curSSAIdMap.end() ? csit->second : 1)-1 } });
    13391348        }
    13401349        auto rbwit = src.rbwSSAIdMap.find(entry.first);
     
    19331942                rblock.pass = 1;
    19341943            if (rblock != routineBlock)
    1935                 joinRoutineData(rdata, routineMap.find(rblock)->second);
     1944                joinRoutineData(rdata, routineMap.find(rblock)->second,
     1945                            curSSAIdMap, rdata.notFirstReturn);
    19361946        }
    19371947       
     
    23572367        else // back
    23582368        {
    2359             RoutineData* rdata = nullptr;
    2360             if (!callStack.empty())
    2361                 rdata = &(routineMap.find(callStack.back().routineBlock)->second);
    2362            
    23632369            // revert retSSAIdMap
    2364             revertRetSSAIdMap(curSSAIdMap, retSSAIdMap, entry, rdata);
     2370            revertRetSSAIdMap(curSSAIdMap, retSSAIdMap, entry, nullptr);
    23652371            //
    23662372           
  • CLRadeonExtender/trunk/tests/amdasm/AsmRegAllocCase3.cpp

    r3960 r3963  
    386386            { { "sa", 4 }, { { 2, 1 }, { 4, 3 }, { 3, 1 }, { 5, 1 },
    387387                        { 6, 1 }, { 8, 3 }, { 7, 3 } } },
    388             { { "sa", 5 }, { { 2, 1 }, { 3, 1 }, { 4, 1 }, { 5, 1 } } }
     388            { { "sa", 5 }, { { 2, 1 }, { 4, 1 }, { 5, 1 }, { 3, 1 } } }
    389389        },
    390390        true, ""
Note: See TracChangeset for help on using the changeset viewer.