summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SpillPlacement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SpillPlacement.cpp')
-rw-r--r--lib/CodeGen/SpillPlacement.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SpillPlacement.cpp b/lib/CodeGen/SpillPlacement.cpp
index 02c2035f4f..fb5b927d49 100644
--- a/lib/CodeGen/SpillPlacement.cpp
+++ b/lib/CodeGen/SpillPlacement.cpp
@@ -323,10 +323,12 @@ void SpillPlacement::iterate() {
// affect the entire network in a single iteration. That means very fast
// convergence, usually in a single iteration.
for (unsigned iteration = 0; iteration != 10; ++iteration) {
- // Scan backwards, skipping the last node which was just updated.
+ // Scan backwards, skipping the last node when iteration is not zero. When
+ // iteration is not zero, the last node was just updated.
bool Changed = false;
for (SmallVectorImpl<unsigned>::const_reverse_iterator I =
- llvm::next(Linked.rbegin()), E = Linked.rend(); I != E; ++I) {
+ iteration == 0 ? Linked.rbegin() : llvm::next(Linked.rbegin()),
+ E = Linked.rend(); I != E; ++I) {
unsigned n = *I;
if (nodes[n].update(nodes)) {
Changed = true;