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
17#include "llvm/ADT/IntrusiveRefCntPtr.h"
18#include "llvm/IR/PassManager.h"
19#include "llvm/Pass.h"
20#include "llvm/Support/CommandLine.h"
21#include <string>
22
23namespace llvm {
24
25class Module;
26
27extern cl::opt<int> SampleHotCallSiteThreshold;
28extern cl::opt<int> SampleColdCallSiteThreshold;
29extern cl::opt<int> ProfileInlineGrowthLimit;
30extern cl::opt<int> ProfileInlineLimitMin;
31extern cl::opt<int> ProfileInlineLimitMax;
32extern cl::opt<bool> SortProfiledSCC;
33
34namespace vfs {
35class FileSystem;
36} // namespace vfs
37
38/// The sample profiler data loader pass.
39class SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> {
40public:
41 SampleProfileLoaderPass(
42 std::string File = "", std::string RemappingFile = "",
43 ThinOrFullLTOPhase LTOPhase = ThinOrFullLTOPhase::None,
44 IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr);
45
46 PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
47
48private:
49 std::string ProfileFileName;
50 std::string ProfileRemappingFileName;
51 const ThinOrFullLTOPhase LTOPhase;
52 IntrusiveRefCntPtr<vfs::FileSystem> FS;
53};
54
55} // end namespace llvm
56
57#endif // LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
58

source code of llvm/include/llvm/Transforms/IPO/SampleProfile.h