Changeset 3882 in CLRX


Ignore:
Timestamp:
Mar 8, 2018, 8:19:55 AM (6 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: Store previous retSSAId after writing without read before (for including other ways where can be reduced).

File:
1 edited

Legend:

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

    r3881 r3882  
    12231223static void reduceSSAIds(std::unordered_map<AsmSingleVReg, size_t>& curSSAIdMap,
    12241224            RetSSAIdMap& retSSAIdMap, std::unordered_map<size_t, RoutineData>& routineMap,
    1225             SSAReplacesMap& ssaReplacesMap, SSAEntry& ssaEntry)
     1225            SSAReplacesMap& ssaReplacesMap, FlowStackEntry& entry, SSAEntry& ssaEntry)
    12261226{
    12271227    SSAInfo& sinfo = ssaEntry.second;
     
    12571257    }
    12581258    else if (ssaIdsIt != retSSAIdMap.end() && sinfo.ssaIdChange!=0)
     1259    {
     1260        // put before removing to revert for other ways after calls
     1261        auto res = entry.prevRetSSAIdSets.insert(*ssaIdsIt);
     1262        if (res.second)
     1263            res.first->second = ssaIdsIt->second;
    12591264        // just remove, if some change without read before
    12601265        retSSAIdMap.erase(ssaIdsIt);
     1266    }
    12611267}
    12621268
     
    13281334        if (rdata!=nullptr)
    13291335        {
    1330             VectorSet<size_t>& ssaIds = rdata->curSSAIdMap[v.first];
    1331             for (size_t ssaId: rfit->second.ssaIds)
    1332                 ssaIds.eraseValue(ssaId);
     1336            auto csit = rdata->curSSAIdMap.find(v.first);
     1337            if (csit != rdata->curSSAIdMap.end())
     1338            {
     1339                VectorSet<size_t>& ssaIds = csit->second;
     1340                for (size_t ssaId: rfit->second.ssaIds)
     1341                    ssaIds.eraseValue(ssaId);
     1342            }
    13331343        }
    13341344       
    13351345        if (!v.second.ssaIds.empty())
    1336             rfit->second = v.second;
     1346        {
     1347            // just add if previously present
     1348            if (rfit != retSSAIdMap.end())
     1349                rfit->second = v.second;
     1350            else
     1351                retSSAIdMap.insert(v);
     1352        }
    13371353        else // erase if empty
    13381354            retSSAIdMap.erase(v.first);
     
    17031719                   
    17041720                    reduceSSAIds(curSSAIdMap, retSSAIdMap, routineMap, ssaReplacesMap,
    1705                                  ssaEntry);
     1721                                 entry, ssaEntry);
    17061722                   
    17071723                    size_t& ssaId = curSSAIdMap[ssaEntry.first];
Note: See TracChangeset for help on using the changeset viewer.