[semantic-arc-opts] Create a new pass called semantic arc opts.

I am going to run it very early and use it to ensure that extra copies due to my
refactoring of SILGenPattern do not cause COW copies to be introduced.

For now, it does a very simple optimization, namely, it eliminates a copy_value,
with only a destroy_value user on a guaranteed parameter.

It is now disabled behind a flag.
This commit is contained in:
Michael Gottesman
2017-04-05 15:08:10 -07:00
parent a0f903eaf1
commit 5e278fdf67
9 changed files with 126 additions and 3 deletions

View File

@@ -1296,6 +1296,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.EnableSILOwnership |= Args.hasArg(OPT_enable_sil_ownership);
Opts.AssumeUnqualifiedOwnershipWhenParsing
|= Args.hasArg(OPT_assume_parsing_unqualified_ownership_sil);
Opts.EnableMandatorySemanticARCOpts |=
Args.hasArg(OPT_enable_mandatory_semantic_arc_opts);
if (Args.hasArg(OPT_debug_on_sil)) {
// Derive the name of the SIL file for debugging from