summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-08 05:51:08 +0000
committerChris Lattner <sabre@nondot.org>2002-12-08 05:51:08 +0000
commit4f96aa450e8647abe4df2f9aab3de719e6933db3 (patch)
tree80516680d9e8b66144e3740f6012f8f0543be749 /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
parent3935d2b1ec200de9f55bb93e65638c1f98696477 (diff)
downloadbcm5719-llvm-4f96aa450e8647abe4df2f9aab3de719e6933db3.tar.gz
bcm5719-llvm-4f96aa450e8647abe4df2f9aab3de719e6933db3.zip
Add support to count the number of dynamic instructions executed by LLI
llvm-svn: 4955
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index d11ed6e5218..3d6cf0bfb9c 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -15,6 +15,7 @@
#include "llvm/Assembly/Writer.h"
#include "llvm/Target/TargetData.h"
#include "Support/CommandLine.h"
+#include "Support/Statistic.h"
#include <math.h> // For fmod
#include <signal.h>
#include <setjmp.h>
@@ -22,6 +23,10 @@ using std::vector;
using std::cout;
using std::cerr;
+namespace {
+ Statistic<> NumDynamicInsts("lli", "Number of dynamic instructions executed");
+}
+
static cl::opt<bool>
QuietMode("quiet", cl::desc("Do not emit any non-program output"));
@@ -1251,6 +1256,9 @@ bool Interpreter::executeInstruction() {
if (Trace)
CW << "Run:" << I;
+ // Track the number of dynamic instructions executed.
+ ++NumDynamicInsts;
+
// Set a sigsetjmp buffer so that we can recover if an error happens during
// instruction execution...
//
OpenPOWER on IntegriCloud