LLVM  14.0.0git
PGOOptions.h
Go to the documentation of this file.
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/Support/Error.h"
18 
19 namespace llvm {
20 
21 /// A struct capturing PGO tunables.
22 struct PGOOptions {
25  PGOOptions(std::string ProfileFile = "", std::string CSProfileGenFile = "",
26  std::string ProfileRemappingFile = "", PGOAction Action = NoAction,
28  bool DebugInfoForProfiling = false,
29  bool PseudoProbeForProfiling = false)
33  (Action == SampleUse &&
36  // Note, we do allow ProfileFile.empty() for Action=IRUse LTO can
37  // callback with IRUse action without ProfileFile.
38 
39  // If there is a CSAction, PGOAction cannot be IRInstr or SampleUse.
40  assert(this->CSAction == NoCSAction ||
41  (this->Action != IRInstr && this->Action != SampleUse));
42 
43  // For CSIRInstr, CSProfileGenFile also needs to be nonempty.
44  assert(this->CSAction != CSIRInstr || !this->CSProfileGenFile.empty());
45 
46  // If CSAction is CSIRUse, PGOAction needs to be IRUse as they share
47  // a profile.
48  assert(this->CSAction != CSIRUse || this->Action == IRUse);
49 
50  // If neither Action nor CSAction, DebugInfoForProfiling or
51  // PseudoProbeForProfiling needs to be true.
52  assert(this->Action != NoAction || this->CSAction != NoCSAction ||
54  }
55  std::string ProfileFile;
56  std::string CSProfileGenFile;
57  std::string ProfileRemappingFile;
62 };
63 } // namespace llvm
64 
65 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::PGOOptions::CSProfileGenFile
std::string CSProfileGenFile
Definition: PGOOptions.h:56
Error.h
llvm::PGOOptions::CSPGOAction
CSPGOAction
Definition: PGOOptions.h:24
llvm::PGOOptions::SampleUse
@ SampleUse
Definition: PGOOptions.h:23
llvm::PGOOptions::PseudoProbeForProfiling
bool PseudoProbeForProfiling
Definition: PGOOptions.h:61
llvm::PGOOptions::IRUse
@ IRUse
Definition: PGOOptions.h:23
llvm::PGOOptions::CSIRInstr
@ CSIRInstr
Definition: PGOOptions.h:24
llvm::PGOOptions::CSAction
CSPGOAction CSAction
Definition: PGOOptions.h:59
llvm::PGOOptions::NoCSAction
@ NoCSAction
Definition: PGOOptions.h:24
llvm::PGOOptions::ProfileFile
std::string ProfileFile
Definition: PGOOptions.h:55
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::PGOOptions::DebugInfoForProfiling
bool DebugInfoForProfiling
Definition: PGOOptions.h:60
llvm::PGOOptions::NoAction
@ NoAction
Definition: PGOOptions.h:23
llvm::PGOOptions
A struct capturing PGO tunables.
Definition: PGOOptions.h:22
llvm::PGOOptions::Action
PGOAction Action
Definition: PGOOptions.h:58
llvm::PGOOptions::CSIRUse
@ CSIRUse
Definition: PGOOptions.h:24
llvm::PGOOptions::PGOAction
PGOAction
Definition: PGOOptions.h:23
llvm::PGOOptions::ProfileRemappingFile
std::string ProfileRemappingFile
Definition: PGOOptions.h:57
llvm::PGOOptions::IRInstr
@ IRInstr
Definition: PGOOptions.h:23
llvm::PGOOptions::PGOOptions
PGOOptions(std::string ProfileFile="", std::string CSProfileGenFile="", std::string ProfileRemappingFile="", PGOAction Action=NoAction, CSPGOAction CSAction=NoCSAction, bool DebugInfoForProfiling=false, bool PseudoProbeForProfiling=false)
Definition: PGOOptions.h:25