Add the frontend option -disable-sil-perf-optzns.

Swift SVN r20604
This commit is contained in:
Michael Gottesman
2014-07-27 18:37:11 +00:00
parent 06a9ea552c
commit 112269fb33
4 changed files with 12 additions and 1 deletions

View File

@@ -50,6 +50,11 @@ public:
/// Controls whether the SIL ARC optimizations are run.
bool EnableARCOptimizations = true;
/// Should we run any SIL performance optimizations
///
/// Useful when you want to enable -O LLVM opts but not -O SIL opts.
bool DisableSILPerfOptimizations = false;
/// Controls whether or not paranoid verification checks are run.
bool VerifyAll = false;

View File

@@ -109,6 +109,9 @@ def disable_diagnostic_passes : Flag<["-"], "disable-diagnostic-passes">,
def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
HelpText<"Don't run LLVM optimization passes">;
def disable_sil_perf_optzns : Flag<["-"], "disable-sil-perf-optzns">,
HelpText<"Don't run SIL performance optimization passes">;
def disable_llvm_arc_opts : Flag<["-"], "disable-llvm-arc-opts">,
HelpText<"Don't run LLVM ARC optimization passes.">;

View File

@@ -766,6 +766,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.RemoveRuntimeAsserts |= Args.hasArg(OPT_remove_runtime_asserts);
Opts.EnableARCOptimizations |= !Args.hasArg(OPT_disable_arc_opts);
Opts.DisableSILPerfOptimizations |= Args.hasArg(OPT_disable_sil_perf_optzns);
Opts.VerifyAll |= Args.hasArg(OPT_sil_verify_all);
Opts.PrintAll |= Args.hasArg(OPT_sil_print_all);
Opts.TimeTransforms |= Args.hasArg(OPT_sil_time_transforms);

View File

@@ -148,9 +148,11 @@ void AddSSAPasses(SILPassManager &PM, SILModule &Module,
PM.add(createGlobalARCOpts());
}
void swift::runSILOptimizationPasses(SILModule &Module,
const SILOptions &Options) {
if (Options.DisableSILPerfOptimizations)
return;
if (Options.DebugSerialization) {
SILPassManager PM(&Module, Options);
registerAnalysisPasses(PM, &Module);