@@ -835,7 +835,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
835835 if (CodeGenOpts.hasProfileIRInstr ())
836836 // -fprofile-generate.
837837 PGOOpt = PGOOptions (getProfileGenName (CodeGenOpts), " " , " " ,
838- CodeGenOpts.MemoryProfileUsePath , nullptr ,
838+ CodeGenOpts.MemoryProfileUsePath ,
839+ CodeGenOpts.PropellerProfileFile , nullptr ,
839840 PGOOptions::IRInstr, PGOOptions::NoCSAction,
840841 ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling ,
841842 /* PseudoProbeForProfiling=*/ false ,
@@ -846,30 +847,41 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
846847 : PGOOptions::NoCSAction;
847848 PGOOpt = PGOOptions (CodeGenOpts.ProfileInstrumentUsePath , " " ,
848849 CodeGenOpts.ProfileRemappingFile ,
849- CodeGenOpts.MemoryProfileUsePath , VFS,
850+ CodeGenOpts.MemoryProfileUsePath ,
851+ CodeGenOpts.PropellerProfileFile , VFS,
850852 PGOOptions::IRUse, CSAction, ClPGOColdFuncAttr,
851853 CodeGenOpts.DebugInfoForProfiling );
852854 } else if (!CodeGenOpts.SampleProfileFile .empty ())
853855 // -fprofile-sample-use
854856 PGOOpt = PGOOptions (
855857 CodeGenOpts.SampleProfileFile , " " , CodeGenOpts.ProfileRemappingFile ,
856- CodeGenOpts.MemoryProfileUsePath , VFS, PGOOptions::SampleUse,
858+ CodeGenOpts.MemoryProfileUsePath ,
859+ CodeGenOpts.PropellerProfileFile , VFS, PGOOptions::SampleUse,
857860 PGOOptions::NoCSAction, ClPGOColdFuncAttr,
858861 CodeGenOpts.DebugInfoForProfiling , CodeGenOpts.PseudoProbeForProfiling );
859862 else if (!CodeGenOpts.MemoryProfileUsePath .empty ())
860863 // -fmemory-profile-use (without any of the above options)
861- PGOOpt = PGOOptions (" " , " " , " " , CodeGenOpts.MemoryProfileUsePath , VFS,
864+ PGOOpt = PGOOptions (" " , " " , " " , CodeGenOpts.MemoryProfileUsePath ,
865+ CodeGenOpts.PropellerProfileFile , VFS,
862866 PGOOptions::NoAction, PGOOptions::NoCSAction,
863867 ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling );
868+ else if (!CodeGenOpts.PropellerProfileFile .empty ())
869+ // -fpropeller-profile-use (without any of the above options)
870+ PGOOpt = PGOOptions (" " , " " , " " , " " ,
871+ CodeGenOpts.PropellerProfileFile , VFS,
872+ PGOOptions::NoAction, PGOOptions::NoCSAction,
873+ ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling );
864874 else if (CodeGenOpts.PseudoProbeForProfiling )
865875 // -fpseudo-probe-for-profiling
866876 PGOOpt =
867- PGOOptions (" " , " " , " " , /* MemoryProfile=*/ " " , nullptr ,
877+ PGOOptions (" " , " " , " " , /* MemoryProfile=*/ " " ,
878+ /* PropellerProfileFile=*/ " " , nullptr ,
868879 PGOOptions::NoAction, PGOOptions::NoCSAction,
869880 ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling , true );
870881 else if (CodeGenOpts.DebugInfoForProfiling )
871882 // -fdebug-info-for-profiling
872- PGOOpt = PGOOptions (" " , " " , " " , /* MemoryProfile=*/ " " , nullptr ,
883+ PGOOpt = PGOOptions (" " , " " , " " , /* MemoryProfile=*/ " " ,
884+ /* PropellerProfileFile=*/ " " , nullptr ,
873885 PGOOptions::NoAction, PGOOptions::NoCSAction,
874886 ClPGOColdFuncAttr, true );
875887
@@ -887,7 +899,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
887899 PGOOpt->CSAction = PGOOptions::CSIRInstr;
888900 } else
889901 PGOOpt = PGOOptions (" " , getProfileGenName (CodeGenOpts), " " ,
890- /* MemoryProfile=*/ " " , nullptr , PGOOptions::NoAction,
902+ /* MemoryProfile=*/ " " , /* PropellerProfileFile=*/ " " ,
903+ nullptr , PGOOptions::NoAction,
891904 PGOOptions::CSIRInstr, ClPGOColdFuncAttr,
892905 CodeGenOpts.DebugInfoForProfiling );
893906 }
@@ -1320,6 +1333,7 @@ runThinLTOBackend(CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex,
13201333 Conf.OptLevel = CGOpts.OptimizationLevel ;
13211334 initTargetOptions (CI, Diags, Conf.Options );
13221335 Conf.SampleProfile = std::move (SampleProfile);
1336+ Conf.PropellerProfile = CGOpts.PropellerProfileFile ;
13231337 Conf.PTO .LoopUnrolling = CGOpts.UnrollLoops ;
13241338 Conf.PTO .LoopInterchange = CGOpts.InterchangeLoops ;
13251339 // For historical reasons, loop interleaving is set to mirror setting for loop
0 commit comments