Changeset 3997 in CLRX


Ignore:
Timestamp:
Apr 14, 2018, 2:59:16 PM (8 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmRegAlloc?: First testcase for AsmRegAlloc::applySSAReplaces routine. Add new constructor to AsmRegAllocator? (to simplify testing).
Add new constructor to VectoSet?.

Location:
CLRadeonExtender/trunk
Files:
1 added
4 edited

Legend:

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

    r3897 r3997  
    365365    std::unordered_map<size_t, size_t> equalSetMaps[MAX_REGTYPES_NUM];
    366366    std::vector<std::vector<size_t> > equalSetLists[MAX_REGTYPES_NUM];
     367   
    367368public:
    368369    AsmRegAllocator(Assembler& assembler);
     370    // constructor for testing
     371    AsmRegAllocator(Assembler& assembler, const std::vector<CodeBlock>& codeBlocks,
     372                const SSAReplacesMap& ssaReplacesMap);
    369373   
    370374    void createCodeStructure(const std::vector<AsmCodeFlowEntry>& codeFlow,
  • CLRadeonExtender/trunk/CLRX/utils/Containers.h

    r3991 r3997  
    303303   
    304304    /// constructor
     305    template<typename It>
     306    VectorSet(It first, It last) : std::vector<T>(first, last)
     307    { }
     308   
     309    /// constructor
    305310    VectorSet(std::initializer_list<T> l): std::vector<T>(l)
    306311    { }
  • CLRadeonExtender/trunk/amdasm/AsmRegAlloc.cpp

    r3993 r3997  
    259259
    260260AsmRegAllocator::AsmRegAllocator(Assembler& _assembler) : assembler(_assembler)
     261{ }
     262
     263AsmRegAllocator::AsmRegAllocator(Assembler& _assembler,
     264        const std::vector<CodeBlock>& _codeBlocks, const SSAReplacesMap& _ssaReplacesMap)
     265        : assembler(_assembler), codeBlocks(_codeBlocks), ssaReplacesMap(_ssaReplacesMap)
    261266{ }
    262267
     
    465470        std::unordered_set<size_t>::const_iterator nextIt;
    466471        size_t minSSAId;
     472       
     473        MinSSAGraphStackEntry(
     474                std::unordered_map<size_t, MinSSAGraphNode>::iterator _nodeIt,
     475                std::unordered_set<size_t>::const_iterator _nextIt,
     476                size_t _minSSAId = SIZE_MAX)
     477                : nodeIt(_nodeIt), nextIt(_nextIt), minSSAId(_minSSAId)
     478        { }
    467479    };
    468480   
     
    530542            }
    531543            // skip visited nodes
    532             while (ssaGraphNodeIt != ssaGraphNodes.end())
     544            for(; ssaGraphNodeIt != ssaGraphNodes.end(); ++ssaGraphNodeIt)
    533545                if (!ssaGraphNodeIt->second.visited)
    534546                    break;
  • CLRadeonExtender/trunk/tests/amdasm/CMakeLists.txt

    r3916 r3997  
    8989TEST_LINK_LIBRARIES(AsmRegAlloc CLRXAmdAsm CLRXAmdBin CLRXUtils)
    9090ADD_TEST(AsmRegAlloc AsmRegAlloc)
     91
     92ADD_EXECUTABLE(AsmRegAlloc2 AsmRegAlloc2.cpp)
     93TEST_LINK_LIBRARIES(AsmRegAlloc2 CLRXAmdAsm CLRXAmdBin CLRXUtils)
     94ADD_TEST(AsmRegAlloc2 AsmRegAlloc2)
Note: See TracChangeset for help on using the changeset viewer.