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 PGOOptions(const PGOOptions &); 37 ~PGOOptions(); 38 PGOOptions &operator=(const PGOOptions &); 39 40 std::string ProfileFile; 41 std::string CSProfileGenFile; 42 std::string ProfileRemappingFile; 43 std::string MemoryProfile; 44 PGOAction Action; 45 CSPGOAction CSAction; 46 bool DebugInfoForProfiling; 47 bool PseudoProbeForProfiling; 48 IntrusiveRefCntPtr<vfs::FileSystem> FS; 49 }; 50 } // namespace llvm 51 52 #endif 53