Index: lib/CodeGen/RegAllocGreedy.cpp =================================================================== --- lib/CodeGen/RegAllocGreedy.cpp +++ lib/CodeGen/RegAllocGreedy.cpp @@ -1042,6 +1042,7 @@ unsigned Visited = 0; #endif + unsigned j = 0; for (;;) { ArrayRef NewBundles = SpillPlacer->getRecentPositive(); // Find new through blocks in the periphery of PrefRegBundles. @@ -1063,7 +1064,7 @@ } } // Any new blocks to add? - if (ActiveBlocks.size() == AddedTo) + if (ActiveBlocks.size() == AddedTo || j++ > 16) break; // Compute through constraints from the interference, or assume that all