1 //===- RSProfiling.cpp - 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 //===----------------------------------------------------------------------===//
15 // By default, we provide some convienence stuff to clients, so they
16 // can just store the instructions they create to do profiling.
17 // also, handle all chaining issues.
18 // a client is free to overwrite these, as long as it implements the
20 struct RSProfilers : public ModulePass {
21 std::set<Value*> profcode;
22 virtual bool isProfiling(Value* v);
23 virtual ~RSProfilers() {}
24 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
25 void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
26 GlobalValue *CounterArray);