mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[PGO] Context sensitive PGO (part 2)
Part 2 of CSPGO changes (mostly related to ProfileSummary). Note that I use a default parameter in setProfileSummary() and getSummary(). This is to break the dependency in clang. I will make the parameter explicit after changing clang in a separated patch. Differential Revision: https://reviews.llvm.org/D54175 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355131 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+8
-4
@@ -531,12 +531,16 @@ void Module::setCodeModel(CodeModel::Model CL) {
|
||||
addModuleFlag(ModFlagBehavior::Error, "Code Model", CL);
|
||||
}
|
||||
|
||||
void Module::setProfileSummary(Metadata *M) {
|
||||
addModuleFlag(ModFlagBehavior::Error, "ProfileSummary", M);
|
||||
void Module::setProfileSummary(Metadata *M, ProfileSummary::Kind Kind) {
|
||||
if (Kind == ProfileSummary::PSK_CSInstr)
|
||||
addModuleFlag(ModFlagBehavior::Error, "CSProfileSummary", M);
|
||||
else
|
||||
addModuleFlag(ModFlagBehavior::Error, "ProfileSummary", M);
|
||||
}
|
||||
|
||||
Metadata *Module::getProfileSummary() {
|
||||
return getModuleFlag("ProfileSummary");
|
||||
Metadata *Module::getProfileSummary(bool IsCS) {
|
||||
return (IsCS ? getModuleFlag("CSProfileSummary")
|
||||
: getModuleFlag("ProfileSummary"));
|
||||
}
|
||||
|
||||
void Module::setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB) {
|
||||
|
||||
Reference in New Issue
Block a user