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 <string>
21 
22 namespace llvm {
23 
24 class Module;
25 
26 namespace vfs {
27 class FileSystem;
28 } // namespace vfs
29 
30 /// The sample profiler data loader pass.
31 class SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> {
32 public:
33   SampleProfileLoaderPass(
34       std::string File = "", std::string RemappingFile = "",
35       ThinOrFullLTOPhase LTOPhase = ThinOrFullLTOPhase::None,
36       IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr);
37 
38   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
39 
40 private:
41   std::string ProfileFileName;
42   std::string ProfileRemappingFileName;
43   const ThinOrFullLTOPhase LTOPhase;
44   IntrusiveRefCntPtr<vfs::FileSystem> FS;
45 };
46 
47 } // end namespace llvm
48 
49 #endif // LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
50