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