[llvm-commits] CVS: llvm/lib/Transforms/IPO/LoopExtractor.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 17 23:47:00 PST 2004


Changes in directory llvm/lib/Transforms/IPO:

LoopExtractor.cpp updated: 1.9 -> 1.10

---
Log message:

Add statistics to the loop extractor.  The loop extractor has successfully 
extracted all 63 loops for Olden/bh without crashing and without 
miscompiling the program!!!


---
Diffs of the changes:  (+6 -0)

Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp
diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.9 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.10
--- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.9	Wed Mar 17 23:43:18 2004
+++ llvm/lib/Transforms/IPO/LoopExtractor.cpp	Wed Mar 17 23:46:10 2004
@@ -22,9 +22,12 @@
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/FunctionUtils.h"
+#include "Support/Statistic.h"
 using namespace llvm;
 
 namespace {
+  Statistic<> NumExtracted("loop-extract", "Number of loops extracted");
+  
   // FIXME: This is not a function pass, but the PassManager doesn't allow
   // Module passes to require FunctionPasses, so we can't get loop info if we're
   // not a function pass.
@@ -72,6 +75,7 @@
       if (NumLoops == 0) return Changed;
       --NumLoops;
       Changed |= ExtractLoop(DS, *i) != 0;
+      ++NumExtracted;
     }
   } else {
     // Otherwise there is exactly one top-level loop.  If this function is more
@@ -99,6 +103,7 @@
       if (NumLoops == 0) return Changed;
       --NumLoops;
       Changed |= ExtractLoop(DS, TLL) != 0;
+      ++NumExtracted;
     } else {
       // Okay, this function is a minimal container around the specified loop.
       // If we extract the loop, we will continue to just keep extracting it
@@ -108,6 +113,7 @@
         if (NumLoops == 0) return Changed;
         --NumLoops;
         Changed |= ExtractLoop(DS, *i) != 0;
+        ++NumExtracted;
       }
     }
   }





More information about the llvm-commits mailing list