Count uses in all nested loops, not just the deepest.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 5 Oct 2010 23:10:12 +0000 (23:10 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 5 Oct 2010 23:10:12 +0000 (23:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115710 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SplitKit.cpp

index c47e9c91824bebb202844809dc89cacd249caee7..4aea192eb5f463ce589e8e949087a57e1d2aae5e 100644 (file)
@@ -68,7 +68,8 @@ void SplitAnalysis::analyzeUses() {
     MachineBasicBlock *MBB = MI->getParent();
     if (usingBlocks_[MBB]++)
       continue;
-    if (MachineLoop *Loop = loops_.getLoopFor(MBB))
+    for (MachineLoop *Loop = loops_.getLoopFor(MBB); Loop;
+         Loop = Loop->getParentLoop())
       usingLoops_[Loop]++;
   }
   DEBUG(dbgs() << "  counted "