Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //===- RSProfiling.h - Various profiling using random sampling ----------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 081ce94 | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // See notes in RSProfiling.cpp |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | #include "llvm/Transforms/RSProfiling.h" |
| 14 | #include <set> |
| 15 | |
| 16 | namespace llvm { |
| 17 | /// RSProfilers_std - a simple support class for profilers that handles most |
| 18 | /// of the work of chaining and tracking inserted code. |
| 19 | struct RSProfilers_std : public RSProfilers { |
| 20 | static char ID; |
| 21 | std::set<Value*> profcode; |
| 22 | // Lookup up values in profcode |
| 23 | virtual bool isProfiling(Value* v); |
| 24 | // handles required chaining |
| 25 | virtual void getAnalysisUsage(AnalysisUsage &AU) const; |
| 26 | // places counter updates in basic blocks and recordes added instructions in |
| 27 | // profcode |
| 28 | void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, |
| 29 | GlobalValue *CounterArray); |
| 30 | }; |
| 31 | } |