extern llvm::cl::opt<bool> EnablePGSO;
extern llvm::cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
+extern llvm::cl::opt<bool> PGSOIRPassOrTestOnly;
extern llvm::cl::opt<bool> PGSOColdCodeOnly;
extern llvm::cl::opt<bool> PGSOColdCodeOnlyForInstrPGO;
extern llvm::cl::opt<bool> PGSOColdCodeOnlyForSamplePGO;
return true;
if (!EnablePGSO)
return false;
+ // Temporarily enable size optimizations only for the IR pass or test query
+ // sites for gradual commit/rollout. This is to be removed later.
+ if (PGSOIRPassOrTestOnly && !(QueryType == PGSOQueryType::IRPass ||
+ QueryType == PGSOQueryType::Test))
+ return false;
if (isPGSOColdCodeOnly(PSI))
return AdapterT::isFunctionColdInCallGraph(F, PSI, *BFI);
if (PSI->hasSampleProfile())
return true;
if (!EnablePGSO)
return false;
+ // Temporarily enable size optimizations only for the IR pass or test query
+ // sites for gradual commit/rollout. This is to be removed later.
+ if (PGSOIRPassOrTestOnly && !(QueryType == PGSOQueryType::IRPass ||
+ QueryType == PGSOQueryType::Test))
+ return false;
if (isPGSOColdCodeOnly(PSI))
return AdapterT::isColdBlock(BBOrBlockFreq, PSI, BFI);
if (PSI->hasSampleProfile())
cl::desc("Apply the profile guided size optimizations only "
"to cold code under partial-profile sample PGO."));
+cl::opt<bool> PGSOIRPassOrTestOnly(
+ "pgso-ir-pass-or-test-only", cl::Hidden, cl::init(false),
+ cl::desc("Apply the profile guided size optimizations only"
+ "to the IR passes or tests."));
+
cl::opt<bool> ForcePGSO(
"force-pgso", cl::Hidden, cl::init(false),
cl::desc("Force the (profiled-guided) size optimizations. "));