Changeset 3982 in CLRX
- Timestamp:
- Apr 10, 2018, 4:18:18 PM (9 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CLRadeonExtender/trunk/amdasm/AsmRegAlloc.cpp
r3981 r3982 716 716 struct CLRX_INTERNAL FlowStackEntry4 717 717 { 718 BlockIndexblockIndex;718 size_t blockIndex; 719 719 size_t nextIndex; 720 720 bool isCall; … … 2146 2146 } 2147 2147 2148 typedef std::unordered_map< BlockIndex, std::unordered_set<AsmSingleVReg> >2148 typedef std::unordered_map<size_t, std::unordered_set<AsmSingleVReg> > 2149 2149 RecurChangedVarMap; 2150 2150 … … 2259 2259 { 2260 2260 FlowStackEntry4& entry = flowStack.back(); 2261 CodeBlock& cblock = codeBlocks[entry.blockIndex .index];2261 CodeBlock& cblock = codeBlocks[entry.blockIndex]; 2262 2262 2263 2263 if (entry.nextIndex == 0) … … 2274 2274 2275 2275 if (!callStack.empty() && 2276 entry.blockIndex == callStack.back().callBlock &&2276 entry.blockIndex == callStack.back().callBlock.index && 2277 2277 entry.nextIndex-1 == callStack.back().callNextIndex) 2278 2278 { … … 2286 2286 { 2287 2287 bool isCall = false; 2288 BlockIndexnextBlock = cblock.nexts[entry.nextIndex].block;2288 size_t nextBlock = cblock.nexts[entry.nextIndex].block; 2289 2289 2290 2290 if (cblock.nexts[entry.nextIndex].isCall) … … 2295 2295 std::cout << "finding recursions: " << nextBlock << std::endl; 2296 2296 // uncomment after tests 2297 recurChangedVarMap.insert({ nextBlock .index, { } });2297 recurChangedVarMap.insert({ nextBlock, { } }); 2298 2298 entry.nextIndex++; 2299 2299 continue; 2300 2300 } 2301 2301 // comment after tests 2302 //recurChangedVarMap.insert({ nextBlock .index, { } });2302 //recurChangedVarMap.insert({ nextBlock, { } }); 2303 2303 callStack.push_back({ entry.blockIndex, entry.nextIndex, nextBlock }); 2304 2304 std::cout << "finding recur: call: " << nextBlock << std::endl; … … 2332 2332 loopBlocks.clear(); 2333 2333 2334 std::unordered_map< BlockIndex, std::unordered_set<AsmSingleVReg> > chLoopEnds;2334 std::unordered_map<size_t, std::unordered_set<AsmSingleVReg> > chLoopEnds; 2335 2335 2336 2336 while (!flowStack.empty()) 2337 2337 { 2338 2338 FlowStackEntry4& entry = flowStack.back(); 2339 CodeBlock& cblock = codeBlocks[entry.blockIndex .index];2339 CodeBlock& cblock = codeBlocks[entry.blockIndex]; 2340 2340 2341 2341 if (entry.nextIndex == 0) … … 2390 2390 { 2391 2391 bool isCall = false; 2392 BlockIndexnextBlock = cblock.nexts[entry.nextIndex].block;2392 size_t nextBlock = cblock.nexts[entry.nextIndex].block; 2393 2393 flowStack.push_back({ nextBlock, 0, isCall }); 2394 2394 if (flowStackBlocks[nextBlock]) … … 2623 2623 if (cblock.nexts[entry.nextIndex].isCall) 2624 2624 { 2625 bool nextRecursion = false;2625 bool nextRecursion = true; 2626 2626 if (!callBlocks.insert(nextBlock).second) 2627 2627 { 2628 2628 // if already called (then it is recursion) 2629 nextRecursion = recurseBlocks.insert(nextBlock.index).second; 2630 if (nextRecursion) 2629 if (recurseBlocks.insert(nextBlock.index).second) 2631 2630 { 2632 2631 std::cout << " -- recursion: " << nextBlock << std::endl; … … 2637 2636 else if (entry.blockIndex.pass==1) 2638 2637 { 2638 nextRecursion = false; 2639 2639 entry.nextIndex++; 2640 2640 std::cout << " NO call (rec): " << entry.blockIndex << std::endl; 2641 continue;2641 //continue; 2642 2642 } 2643 2643 } … … 2645 2645 recurseBlocks.find(nextBlock.index) != recurseBlocks.end()) 2646 2646 { 2647 nextRecursion = false; 2647 2648 entry.nextIndex++; 2648 2649 std::cout << " NO call (rec)2: " << entry.blockIndex << std::endl; 2650 //continue; 2651 } 2652 2653 if (!nextRecursion) 2649 2654 continue; 2650 }2655 2651 2656 std::cout << " call: " << entry.blockIndex << std::endl; 2652 2657
Note: See TracChangeset
for help on using the changeset viewer.