1 //===- RSProfiling.h - Various profiling using random sampling ----------===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // See notes in RSProfiling.cpp
12 //===----------------------------------------------------------------------===//
13 #include "llvm/Transforms/RSProfiling.h"
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 {
19 std::set<Value*> profcode;
20 // Lookup up values in profcode
21 virtual bool isProfiling(Value* v);
22 // handles required chaining
23 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
24 // places counter updates in basic blocks and recordes added instructions in
26 void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
27 GlobalValue *CounterArray);