LLVM 24.0.0git
SampleProfile.h
Go to the documentation of this file.
1//===- SampleProfile.h - SamplePGO pass ---------- --------------*- 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//
9/// \file
10/// This file provides the interface for the sampled PGO loader pass.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
15#define LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
16
18#include "llvm/IR/PassManager.h"
19#include "llvm/Pass.h"
23#include <string>
24
25namespace llvm {
26
27class LLVMContext;
28class Module;
29
36
37/// The sample profiler data loader pass.
39 : public OptionalPassInfoMixin<SampleProfileLoaderPass> {
40public:
42 std::string File = "", std::string RemappingFile = "",
45 bool DisableSampleProfileInlining = false,
46 bool UseFlattenedProfile = false);
47
49
50 /// Return -sample-profile-file.
52
53private:
54 std::string ProfileFileName;
55 std::string ProfileRemappingFileName;
56 const ThinOrFullLTOPhase LTOPhase;
58 bool DisableSampleProfileInlining;
59 bool UseFlattenedProfile;
60};
61
62} // end namespace llvm
63
64#endif // LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_ABI
Definition Compiler.h:211
This header defines various interfaces for pass management in LLVM.
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
Contains the forward declaration for vfs::FileSystem, as well as the IntrusiveRefCntPtrInfo specializ...
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
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
static LLVM_ABI StringRef getSampleProfileFile(const LLVMContext &C)
Return -sample-profile-file.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
LLVM_ABI SampleProfileLoaderPass(std::string File="", std::string RemappingFile="", ThinOrFullLTOPhase LTOPhase=ThinOrFullLTOPhase::None, IntrusiveRefCntPtr< vfs::FileSystem > FS=nullptr, bool DisableSampleProfileInlining=false, bool UseFlattenedProfile=false)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI cl::opt< int > SampleHotCallSiteThreshold
LLVM_ABI cl::opt< int > ProfileInlineGrowthLimit
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Definition Pass.h:75
@ None
No LTO/ThinLTO behavior needed.
Definition Pass.h:77
LLVM_ABI cl::opt< int > ProfileInlineLimitMax
LLVM_ABI cl::opt< int > SampleColdCallSiteThreshold
LLVM_ABI cl::opt< bool > SortProfiledSCC
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
LLVM_ABI cl::opt< int > ProfileInlineLimitMin
A CRTP mix-in for passes that can be skipped.