LLVM 22.0.0git
PGOOptions.cpp
Go to the documentation of this file.
1//===------ PGOOptions.cpp -- 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
11
12using namespace llvm;
13
15 std::string ProfileRemappingFile,
16 std::string MemoryProfile, PGOAction Action,
27 // Note, we do allow ProfileFile.empty() for Action=IRUse LTO can
28 // callback with IRUse action without ProfileFile.
29
30 // If there is a CSAction, PGOAction cannot be IRInstr or SampleUse.
31 assert(this->CSAction == NoCSAction ||
32 (this->Action != IRInstr && this->Action != SampleUse));
33
34 // For CSIRInstr, CSProfileGenFile also needs to be nonempty.
35 assert(this->CSAction != CSIRInstr || !this->CSProfileGenFile.empty());
36
37 // If CSAction is CSIRUse, PGOAction needs to be IRUse as they share
38 // a profile.
39 assert(this->CSAction != CSIRUse || this->Action == IRUse);
40
41 // Cannot optimize with MemProf profile during IR instrumentation.
42 assert(this->MemoryProfile.empty() || this->Action != PGOOptions::IRInstr);
43
44 // If neither Action nor CSAction nor MemoryProfile are set,
45 // DebugInfoForProfiling or PseudoProbeForProfiling needs to be true.
46 assert(this->Action != NoAction || this->CSAction != NoCSAction ||
47 !this->MemoryProfile.empty() || this->DebugInfoForProfiling ||
48 this->PseudoProbeForProfiling);
49}
50
51PGOOptions::PGOOptions(const PGOOptions &) = default;
52
54
55PGOOptions::~PGOOptions() = default;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Define option tunables for PGO.
Defines the virtual file system interface vfs::FileSystem.
This is an optimization pass for GlobalISel generic memory operations.
A struct capturing PGO tunables.
Definition PGOOptions.h:22
bool DebugInfoForProfiling
Definition PGOOptions.h:45
std::string MemoryProfile
Definition PGOOptions.h:41
std::string ProfileFile
Definition PGOOptions.h:38
std::string CSProfileGenFile
Definition PGOOptions.h:39
PGOAction Action
Definition PGOOptions.h:42
ColdFuncOpt ColdOptType
Definition PGOOptions.h:44
LLVM_ABI PGOOptions & operator=(const PGOOptions &)
std::string ProfileRemappingFile
Definition PGOOptions.h:40
CSPGOAction CSAction
Definition PGOOptions.h:43
bool AtomicCounterUpdate
Definition PGOOptions.h:47
LLVM_ABI PGOOptions(std::string ProfileFile, std::string CSProfileGenFile, std::string ProfileRemappingFile, std::string MemoryProfile, PGOAction Action=NoAction, CSPGOAction CSAction=NoCSAction, ColdFuncOpt ColdType=ColdFuncOpt::Default, bool DebugInfoForProfiling=false, bool PseudoProbeForProfiling=false, bool AtomicCounterUpdate=false)
bool PseudoProbeForProfiling
Definition PGOOptions.h:46
LLVM_ABI ~PGOOptions()