IRGen: Disable type layout based value witness generation at Onone

Type layout based witness generation can emit quite complex IR that will
lead to code bloat if the llvm optimizer is not run.

No need to use type layouts at Onone.

rdar://61155295
This commit is contained in:
Arnold Schwaighofer
2020-04-01 07:17:48 -07:00
parent 1331ac5940
commit 1bde486a63
2 changed files with 8 additions and 0 deletions

View File

@@ -1292,6 +1292,9 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
OPT_disable_type_layouts)) {
Opts.UseTypeLayoutValueHandling
= A->getOption().matches(OPT_enable_type_layouts);
} else if (Opts.OptMode == OptimizationMode::NoOptimization) {
// Disable type layouts at Onone except if explictly requested.
Opts.UseTypeLayoutValueHandling = false;
}
Opts.UseSwiftCall = Args.hasArg(OPT_enable_swiftcall);