mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +00:00
Break infinite loop when the Hopfield network oscillates.
This is impossible in theory, I can prove it. In practice, our near-zero threshold can cause the network to oscillate between equally good solutions. <rdar://problem/9720596> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134428 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
82c475d057
commit
549019792a
@ -649,8 +649,6 @@ void RAGreedy::growRegion(GlobalSplitCandidate &Cand,
|
||||
|
||||
for (;;) {
|
||||
ArrayRef<unsigned> NewBundles = SpillPlacer->getRecentPositive();
|
||||
if (NewBundles.empty())
|
||||
break;
|
||||
// Find new through blocks in the periphery of PrefRegBundles.
|
||||
for (int i = 0, e = NewBundles.size(); i != e; ++i) {
|
||||
unsigned Bundle = NewBundles[i];
|
||||
@ -670,12 +668,12 @@ void RAGreedy::growRegion(GlobalSplitCandidate &Cand,
|
||||
}
|
||||
}
|
||||
// Any new blocks to add?
|
||||
if (ActiveBlocks.size() > AddedTo) {
|
||||
ArrayRef<unsigned> Add(&ActiveBlocks[AddedTo],
|
||||
ActiveBlocks.size() - AddedTo);
|
||||
addThroughConstraints(Intf, Add);
|
||||
AddedTo = ActiveBlocks.size();
|
||||
}
|
||||
if (ActiveBlocks.size() == AddedTo)
|
||||
break;
|
||||
addThroughConstraints(Intf,
|
||||
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
|
||||
AddedTo = ActiveBlocks.size();
|
||||
|
||||
// Perhaps iterating can enable more bundles?
|
||||
SpillPlacer->iterate();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user