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 // This file defines the abstract interface that a profiler must implement to
11 // support the random profiling transform.
13 //===----------------------------------------------------------------------===//
16 //===--------------------------------------------------------------------===//
17 /// RSProfilers - The basic Random Sampling Profiler Interface Any profiler
18 /// that implements this interface can be transformed by the random sampling
19 /// pass to be sample based rather than always on.
21 /// The only exposed function can be queried to find out if an instruction
22 /// was original or if it was inserted by the profiler. Implementations of
23 /// this interface are expected to chain to other implementations, such that
24 /// multiple profilers can be support simultaniously.
25 struct RSProfilers : public ModulePass {
26 /// isProfiling - This method returns true if the value passed it was
27 /// inserted by the profiler.
28 virtual bool isProfiling(Value* v) = 0;