1 //===- Transforms/Instrumentation/InstrProfiling.h --------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 /// \file 9 /// This file provides the interface for LLVM's PGO Instrumentation lowering 10 /// pass. 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H 14 #define LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H 15 16 #include "llvm/IR/PassManager.h" 17 #include "llvm/Support/Compiler.h" 18 #include "llvm/Transforms/Utils/Instrumentation.h" 19 20 namespace llvm { 21 22 class TargetLibraryInfo; 23 /// Instrumentation based profiling lowering pass. This pass lowers 24 /// the profile instrumented code generated by FE or the IR based 25 /// instrumentation pass. 26 class InstrProfilingLoweringPass 27 : public PassInfoMixin<InstrProfilingLoweringPass> { 28 const InstrProfOptions Options = {}; 29 // Is this lowering for the context-sensitive instrumentation. 30 const bool IsCS = false; 31 32 public: 33 InstrProfilingLoweringPass() = default; 34 InstrProfilingLoweringPass(const InstrProfOptions &Options, bool IsCS = false) Options(Options)35 : Options(Options), IsCS(IsCS) {} 36 37 LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); 38 }; 39 } // end namespace llvm 40 41 #endif // LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H 42