diff options
Diffstat (limited to 'llvm/tools/opt/NewPMDriver.cpp')
-rw-r--r-- | llvm/tools/opt/NewPMDriver.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp index fdfb4df..3746980 100644 --- a/llvm/tools/opt/NewPMDriver.cpp +++ b/llvm/tools/opt/NewPMDriver.cpp @@ -202,6 +202,19 @@ static cl::opt<std::string> cl::desc("Path to the profile remapping file."), cl::Hidden); +static cl::opt<PGOOptions::ColdFuncOpt> PGOColdFuncAttr( + "pgo-cold-func-opt", cl::init(PGOOptions::ColdFuncOpt::Default), cl::Hidden, + cl::desc( + "Function attribute to apply to cold functions as determined by PGO"), + cl::values(clEnumValN(PGOOptions::ColdFuncOpt::Default, "default", + "Default (no attribute)"), + clEnumValN(PGOOptions::ColdFuncOpt::OptSize, "optsize", + "Mark cold functions with optsize."), + clEnumValN(PGOOptions::ColdFuncOpt::MinSize, "minsize", + "Mark cold functions with minsize."), + clEnumValN(PGOOptions::ColdFuncOpt::OptNone, "optnone", + "Mark cold functions with optnone."))); + static cl::opt<bool> DebugInfoForProfiling( "debug-info-for-profiling", cl::init(false), cl::Hidden, cl::desc("Emit special debug info to enable PGO profile generation.")); @@ -341,22 +354,24 @@ bool llvm::runPassPipeline( switch (PGOKindFlag) { case InstrGen: P = PGOOptions(ProfileFile, "", "", MemoryProfileFile, FS, - PGOOptions::IRInstr); + PGOOptions::IRInstr, PGOOptions::NoCSAction, + PGOColdFuncAttr); break; case InstrUse: P = PGOOptions(ProfileFile, "", ProfileRemappingFile, MemoryProfileFile, FS, - PGOOptions::IRUse); + PGOOptions::IRUse, PGOOptions::NoCSAction, PGOColdFuncAttr); break; case SampleUse: P = PGOOptions(ProfileFile, "", ProfileRemappingFile, MemoryProfileFile, FS, - PGOOptions::SampleUse); + PGOOptions::SampleUse, PGOOptions::NoCSAction, + PGOColdFuncAttr); break; case NoPGO: if (DebugInfoForProfiling || PseudoProbeForProfiling || !MemoryProfileFile.empty()) P = PGOOptions("", "", "", MemoryProfileFile, FS, PGOOptions::NoAction, - PGOOptions::NoCSAction, DebugInfoForProfiling, - PseudoProbeForProfiling); + PGOOptions::NoCSAction, PGOColdFuncAttr, + DebugInfoForProfiling, PseudoProbeForProfiling); else P = std::nullopt; } |