aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 936ac5a..b3f1b95 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -804,6 +804,9 @@ void CodeViewDebug::emitCompilerInformation() {
// The low byte of the flags indicates the source language.
Flags = MapDWLangToCVLang(CU->getSourceLanguage());
// TODO: Figure out which other flags need to be set.
+ if (MMI->getModule()->getProfileSummary(/*IsCS*/ false) != nullptr) {
+ Flags |= static_cast<uint32_t>(CompileSym3Flags::PGO);
+ }
OS.AddComment("Flags and language");
OS.emitInt32(Flags);
@@ -1428,6 +1431,10 @@ void CodeViewDebug::beginFunctionImpl(const MachineFunction *MF) {
if (Asm->TM.getOptLevel() != CodeGenOpt::None &&
!GV.hasOptSize() && !GV.hasOptNone())
FPO |= FrameProcedureOptions::OptimizedForSpeed;
+ if (GV.hasProfileData()) {
+ FPO |= FrameProcedureOptions::ValidProfileCounts;
+ FPO |= FrameProcedureOptions::ProfileGuidedOptimization;
+ }
// FIXME: Set GuardCfg when it is implemented.
CurFn->FrameProcOpts = FPO;