[SwiftPGO] Add driver support for -profile-use=<path>

This option tells the compiler where to find a profdata file. The
information in this file enables PGO. For more information about the PGO
infrastructure, look for the -profile-generate option and for the
llvm-profdata tool [1].

[1] http://llvm.org/docs/CommandGuide/llvm-profdata.html
This commit is contained in:
Vedant Kumar
2016-08-30 15:17:06 -07:00
committed by Joe Shajrawi
parent f3a7d3ac0f
commit 1621facc6c
8 changed files with 50 additions and 8 deletions

View File

@@ -1458,6 +1458,9 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.ExternalPassPipelineFilename = A->getValue();
Opts.GenerateProfile |= Args.hasArg(OPT_profile_generate);
const Arg *ProfileUse = Args.getLastArg(OPT_profile_use);
Opts.UseProfile = ProfileUse ? ProfileUse->getValue() : "";
Opts.EmitProfileCoverageMapping |= Args.hasArg(OPT_profile_coverage_mapping);
Opts.EnableGuaranteedClosureContexts |=
Args.hasArg(OPT_enable_guaranteed_closure_contexts);
@@ -1639,6 +1642,9 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
}
Opts.GenerateProfile |= Args.hasArg(OPT_profile_generate);
const Arg *ProfileUse = Args.getLastArg(OPT_profile_use);
Opts.UseProfile = ProfileUse ? ProfileUse->getValue() : "";
Opts.PrintInlineTree |= Args.hasArg(OPT_print_llvm_inline_tree);
Opts.UseSwiftCall = Args.hasArg(OPT_enable_swiftcall);