From 449eb3f3be77cc127617eaef3087e04a4307e203 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Thu, 15 Nov 2012 02:32:22 +0000 Subject: [PATCH] Fix an obvious merge bug in -join-globalcopies (disabled). Jakub Staszak spotted this in review. I don't notice these things until I manually rerun benchmarks. But reducing unit tests is a very high priority. llvm-svn: 168021 --- llvm/lib/CodeGen/RegisterCoalescer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index df67975..5d6e0f0 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -2080,8 +2080,10 @@ void RegisterCoalescer::joinAllIntervals() { unsigned CurrDepth = UINT_MAX; for (unsigned i = 0, e = MBBs.size(); i != e; ++i) { // Try coalescing the collected local copies for deeper loops. - if (JoinGlobalCopies && MBBs[i].Depth < CurrDepth) + if (JoinGlobalCopies && MBBs[i].Depth < CurrDepth) { coalesceLocals(); + CurrDepth = MBBs[i].Depth; + } copyCoalesceInMBB(MBBs[i].MBB); } coalesceLocals(); -- 2.7.4