Add a Flag to Force Type Layouts for Structs

Added ForceStructTypeLayouts. When enabled, IRGen will lower structs using the
aligned group of TypeLayout rather than using TypeInfos. This potentially leads
to a size increase as TypeInfos currently produce better code than the
TypeLayout route.
This commit is contained in:
Gwen Mittertreiner
2021-09-10 13:43:02 -07:00
committed by Gwen Mittertreiner
parent 942b0e8a63
commit b6cff0b844
3 changed files with 11 additions and 1 deletions

View File

@@ -1724,6 +1724,9 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
Opts.UseTypeLayoutValueHandling = false;
}
Opts.ForceStructTypeLayouts = Args.hasArg(OPT_force_struct_type_layouts) &&
Opts.UseTypeLayoutValueHandling;
// This is set to true by default.
Opts.UseIncrementalLLVMCodeGen &=
!Args.hasArg(OPT_disable_incremental_llvm_codegeneration);