aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorAnand Shukla <ashukla@cs.uiuc.edu>2002-02-26 18:43:03 +0000
committerAnand Shukla <ashukla@cs.uiuc.edu>2002-02-26 18:43:03 +0000
commitc8e6b10c2c7c1f5ee5576cb5fa42e1f4899ff984 (patch)
treeee6b86378c8c8af1b9ea2d8ca42e7de368278432 /include/llvm/Transforms
parent06e84ed49593778f4c7c47fc141e4395d93d3cdf (diff)
downloadexternal_llvm-c8e6b10c2c7c1f5ee5576cb5fa42e1f4899ff984.zip
external_llvm-c8e6b10c2c7c1f5ee5576cb5fa42e1f4899ff984.tar.gz
external_llvm-c8e6b10c2c7c1f5ee5576cb5fa42e1f4899ff984.tar.bz2
Initial check in of header file for profile-paths pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1801 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/Instrumentation/ProfilePaths.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Instrumentation/ProfilePaths.h b/include/llvm/Transforms/Instrumentation/ProfilePaths.h
new file mode 100644
index 0000000..de9d37c
--- /dev/null
+++ b/include/llvm/Transforms/Instrumentation/ProfilePaths.h
@@ -0,0 +1,43 @@
+//===-- ProfilePaths.h - interface to insert instrumentation -----*- C++ -*--=//
+//
+// This inserts intrumentation for counting
+// execution of paths though a given method
+// Its implemented as a "Method" Pass, and called using opt
+//
+// This pass is implemented by using algorithms similar to
+// 1."Efficient Path Profiling": Ball, T. and Larus, J. R.,
+// Proceedings of Micro-29, Dec 1996, Paris, France.
+// 2."Efficiently Counting Program events with support for on-line
+// "queries": Ball T., ACM Transactions on Programming Languages
+// and systems, Sep 1994.
+//
+// The algorithms work on a Graph constructed over the nodes
+// made from Basic Blocks: The transformations then take place on
+// the constucted graph (implementation in Graph.cpp and GraphAuxillary.cpp)
+// and finally, appropriate instrumentation is placed over suitable edges.
+// (code inserted through EdgeCode.cpp).
+//
+// The algorithm inserts code such that every acyclic path in the CFG
+// of a method is identified through a unique number. the code insertion
+// is optimal in the sense that its inserted over a minimal set of edges. Also,
+// the algorithm makes sure than initialization, path increment and counter
+// update can be collapsed into minmimum number of edges.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_PROFILE_PATHS_H
+#define LLVM_TRANSFORMS_INSTRUMENTATION_PROFILE_PATHS_H
+
+#include "llvm/Pass.h"
+
+class ProfilePaths: public MethodPass {
+ public:
+ bool runOnMethod(Method *M);
+
+ // getAnalysisUsageInfo - transform cfg to have just one exit node
+ virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Requires,
+ Pass::AnalysisSet &Destroyed,
+ Pass::AnalysisSet &Provided);
+};
+
+#endif
+