LLVM 24.0.0git
InstrProfiling.h
Go to the documentation of this file.
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"
19
20namespace llvm {
21
23namespace cl {
25} // namespace cl
26/// Instrumentation based profiling lowering pass. This pass lowers
27/// the profile instrumented code generated by FE or the IR based
28/// instrumentation pass.
30 : public OptionalPassInfoMixin<InstrProfilingLoweringPass> {
31 const InstrProfOptions Options = {};
32 // Is this lowering for the context-sensitive instrumentation.
33 const bool IsCS = false;
34
35public:
37 InstrProfilingLoweringPass(const InstrProfOptions &Options, bool IsCS = false)
38 : Options(Options), IsCS(IsCS) {}
39
41};
42
43/// Return true if -profile-correlate is set.
44LLVM_ABI bool
45isProfileCorrelationEnabled(const cl::LibraryOptionsContext &LibraryOptions);
46} // end namespace llvm
47
48#endif // LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H
#define LLVM_ABI
Definition Compiler.h:211
This header defines various interfaces for pass management in LLVM.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
InstrProfilingLoweringPass(const InstrProfOptions &Options, bool IsCS=false)
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
Provides information about what library functions are available for the current target.
This namespace contains all of the command line option processing machinery.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI bool isProfileCorrelationEnabled(const cl::LibraryOptionsContext &LibraryOptions)
Return true if -profile-correlate is set.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
Options for the frontend instrumentation based profiling pass.
A CRTP mix-in for passes that can be skipped.