Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===------ PGOOptions.h -- PGO option tunables ----------------*- 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 /// \file
0009 ///
0010 /// Define option tunables for PGO.
0011 ///
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_SUPPORT_PGOOPTIONS_H
0015 #define LLVM_SUPPORT_PGOOPTIONS_H
0016 
0017 #include "llvm/ADT/IntrusiveRefCntPtr.h"
0018 #include "llvm/Support/Error.h"
0019 
0020 namespace llvm {
0021 
0022 namespace vfs {
0023 class FileSystem;
0024 } // namespace vfs
0025 
0026 /// A struct capturing PGO tunables.
0027 struct PGOOptions {
0028   enum PGOAction { NoAction, IRInstr, IRUse, SampleUse };
0029   enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse };
0030   enum class ColdFuncOpt { Default, OptSize, MinSize, OptNone };
0031   PGOOptions(std::string ProfileFile, std::string CSProfileGenFile,
0032              std::string ProfileRemappingFile, std::string MemoryProfile,
0033              IntrusiveRefCntPtr<vfs::FileSystem> FS,
0034              PGOAction Action = NoAction, CSPGOAction CSAction = NoCSAction,
0035              ColdFuncOpt ColdType = ColdFuncOpt::Default,
0036              bool DebugInfoForProfiling = false,
0037              bool PseudoProbeForProfiling = false,
0038              bool AtomicCounterUpdate = false);
0039   PGOOptions(const PGOOptions &);
0040   ~PGOOptions();
0041   PGOOptions &operator=(const PGOOptions &);
0042 
0043   std::string ProfileFile;
0044   std::string CSProfileGenFile;
0045   std::string ProfileRemappingFile;
0046   std::string MemoryProfile;
0047   PGOAction Action;
0048   CSPGOAction CSAction;
0049   ColdFuncOpt ColdOptType;
0050   bool DebugInfoForProfiling;
0051   bool PseudoProbeForProfiling;
0052   bool AtomicCounterUpdate;
0053   IntrusiveRefCntPtr<vfs::FileSystem> FS;
0054 };
0055 } // namespace llvm
0056 
0057 #endif