Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:41

0001 //===- SampleProfile.h - SamplePGO pass ---------- --------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 /// \file
0010 /// This file provides the interface for the sampled PGO loader pass.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
0015 #define LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H
0016 
0017 #include "llvm/ADT/IntrusiveRefCntPtr.h"
0018 #include "llvm/IR/PassManager.h"
0019 #include "llvm/Pass.h"
0020 #include "llvm/Support/CommandLine.h"
0021 #include <string>
0022 
0023 namespace llvm {
0024 
0025 class Module;
0026 
0027 extern cl::opt<int> SampleHotCallSiteThreshold;
0028 extern cl::opt<int> SampleColdCallSiteThreshold;
0029 extern cl::opt<int> ProfileInlineGrowthLimit;
0030 extern cl::opt<int> ProfileInlineLimitMin;
0031 extern cl::opt<int> ProfileInlineLimitMax;
0032 extern cl::opt<bool> SortProfiledSCC;
0033 
0034 namespace vfs {
0035 class FileSystem;
0036 } // namespace vfs
0037 
0038 /// The sample profiler data loader pass.
0039 class SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> {
0040 public:
0041   SampleProfileLoaderPass(
0042       std::string File = "", std::string RemappingFile = "",
0043       ThinOrFullLTOPhase LTOPhase = ThinOrFullLTOPhase::None,
0044       IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr,
0045       bool DisableSampleProfileInlining = false,
0046       bool UseFlattenedProfile = false);
0047 
0048   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
0049 
0050 private:
0051   std::string ProfileFileName;
0052   std::string ProfileRemappingFileName;
0053   const ThinOrFullLTOPhase LTOPhase;
0054   IntrusiveRefCntPtr<vfs::FileSystem> FS;
0055   bool DisableSampleProfileInlining;
0056   bool UseFlattenedProfile;
0057 };
0058 
0059 } // end namespace llvm
0060 
0061 #endif // LLVM_TRANSFORMS_IPO_SAMPLEPROFILE_H