1 //===------ PGOOptions.h -- PGO option tunables ----------------*- 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 /// \file
9 ///
10 /// Define option tunables for PGO.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_SUPPORT_PGOOPTIONS_H
15 #define LLVM_SUPPORT_PGOOPTIONS_H
16 
17 #include "llvm/ADT/IntrusiveRefCntPtr.h"
18 #include "llvm/Support/Error.h"
19 
20 namespace llvm {
21 
22 namespace vfs {
23 class FileSystem;
24 } // namespace vfs
25 
26 /// A struct capturing PGO tunables.
27 struct PGOOptions {
28   enum PGOAction { NoAction, IRInstr, IRUse, SampleUse };
29   enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse };
30   PGOOptions(std::string ProfileFile, std::string CSProfileGenFile,
31              std::string ProfileRemappingFile, std::string MemoryProfile,
32              IntrusiveRefCntPtr<vfs::FileSystem> FS,
33              PGOAction Action = NoAction, CSPGOAction CSAction = NoCSAction,
34              bool DebugInfoForProfiling = false,
35              bool PseudoProbeForProfiling = false,
36              bool AtomicCounterUpdate = false);
37   PGOOptions(const PGOOptions &);
38   ~PGOOptions();
39   PGOOptions &operator=(const PGOOptions &);
40 
41   std::string ProfileFile;
42   std::string CSProfileGenFile;
43   std::string ProfileRemappingFile;
44   std::string MemoryProfile;
45   PGOAction Action;
46   CSPGOAction CSAction;
47   bool DebugInfoForProfiling;
48   bool PseudoProbeForProfiling;
49   bool AtomicCounterUpdate;
50   IntrusiveRefCntPtr<vfs::FileSystem> FS;
51 };
52 } // namespace llvm
53 
54 #endif
55