PGO: new -profile-sample-use= frontend flag

This is meant to match clang's `-fprofile-sample-use=` and accepts a
file with the same format.

rdar://135443278
This commit is contained in:
Kavon Farvardin
2024-09-17 15:59:49 -07:00
parent a7336e86f8
commit 2b01714fba
6 changed files with 79 additions and 0 deletions

View File

@@ -3177,6 +3177,9 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
const Arg *ProfileUse = Args.getLastArg(OPT_profile_use);
Opts.UseProfile = ProfileUse ? ProfileUse->getValue() : "";
const Arg *ProfileSampleUse = Args.getLastArg(OPT_profile_sample_use);
Opts.UseSampleProfile = ProfileSampleUse ? ProfileSampleUse->getValue() : "";
Opts.PrintInlineTree |= Args.hasArg(OPT_print_llvm_inline_tree);
// Always producing all outputs when caching is enabled.
Opts.AlwaysCompile |= Args.hasArg(OPT_always_compile_output_files) ||