summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/LoopExtractor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-18 05:46:10 +0000
committerChris Lattner <sabre@nondot.org>2004-03-18 05:46:10 +0000
commitf6e43bc7968df6794e518e964c3428fff86dc0f8 (patch)
treeffb7f481854fee3153c2b104a4bda7591d244be8 /lib/Transforms/IPO/LoopExtractor.cpp
parentfdded9f95ae6233ec553fd54acc11f2dac1aee9d (diff)
downloadllvm-f6e43bc7968df6794e518e964c3428fff86dc0f8.tar.gz
llvm-f6e43bc7968df6794e518e964c3428fff86dc0f8.tar.bz2
llvm-f6e43bc7968df6794e518e964c3428fff86dc0f8.tar.xz
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!!! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LoopExtractor.cpp')
-rw-r--r--lib/Transforms/IPO/LoopExtractor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp
index 083b11684c..6b033b4082 100644
--- a/lib/Transforms/IPO/LoopExtractor.cpp
+++ b/lib/Transforms/IPO/LoopExtractor.cpp
@@ -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 @@ bool LoopExtractor::runOnFunction(Function &F) {
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 @@ bool LoopExtractor::runOnFunction(Function &F) {
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 @@ bool LoopExtractor::runOnFunction(Function &F) {
if (NumLoops == 0) return Changed;
--NumLoops;
Changed |= ExtractLoop(DS, *i) != 0;
+ ++NumExtracted;
}
}
}