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