Have SILGen mark all variables bound from pattern bindings without initializers (and *only* ones without initializers) with mark_uninitialized [var] pseudo instructions. On the DI end, *only* consider mark_uninitialized instructions for DI analysis. This has many benefits:
- DI doesn't waste time analyzing locals that are trivially initialized in the original source code.
- DI doesn't try to mangle canonical SIL that has been inlined from transparent functions, which may have been optimized into a form DI isn't written to understand.
While we're here, fix an issue with DCE where it would try to kill unused MarkUninitialized instructions. Although MarkUninitialized has no side effects, it still is semantically important to raw SIL, and can't be killed.
Chris did most of the work here; I just finished updating tests and fixing bugs.
Swift SVN r13247
This pass is attempting to do a simple optimization where it determines if we
have an allocbox that has a most post dominating retain together which it
forms a single entry/single exit region.
It does this by checking domination/post-domination, but it does not check
control equivalence. This patch puts in a check to make sure that if we have a
cycle into the entry BB, we do not optimize.
rdar://15832873.
Swift SVN r12662
In nongeneric contexts, or contexts where we only care about the indirectness of parameters or have already substituted the generic parameters for a function, the interface types are interchangeable, so just switch over.
Swift SVN r12044
to avoid confusing uses of the box with uses of the allocation in partial
apply instructions. This resolves rdar://15595118.
Unfortunately, the testcase cannot be reduced into something that the
silparser handles, since it goes away when non-generic.
Swift SVN r11408
Remove the initialize_var instruction now that DI fully diagnoses initialization problems. Change String-to-NSString bridging to explicitly invoke String's default constructor; it was the last remaining user of initialize_var. Remove dead code to emit an implicit default constructor without a body.
Swift SVN r11066
new mark_unitialized instructions. These defeated the alloc_box to stack promotion
pass, so everything ended up on the heap, leading to really terrible performance.
This updates things to understand mark_uninitialized, allowing us to promote them.
This fixes rdar://15607469.
Swift SVN r10985
The empty tuple used for return value when none is supplied does not really correspond to user code. (We don’t have epilog, so mark it as pert of cleanup.)
The destroy_addr instructions are doing the cleanup.
Swift SVN r9765
clean up a couple random things in silcombiner:
- it shouldn't return "made any changes" out of the pass.
- statistics should be spelled out more and don't end with periods.
Swift SVN r9755
promote a lot more boxes. This is the last step to resolve
rdar://15228172 getting us back O(n) string performance. There is
still more work to do, but this is progress.
Swift SVN r9751
There are no values other than instructions that can use other values. BBArguments are
defs, not uses. This eliminates a bunch of casts in clients that use getUser().
Swift SVN r9701
Most alloc_stacks emitted by SILGen are temporaries and don't need to be preserved for debug info. It's only the ones that relate to local variables that we need to preserve. Fixes <rdar://problem/15272642>.
Swift SVN r9543
This will allow us to differentiate from regular inlined code (as in optimization inlining). Some passes(AllocBocToStack) and debug info would be allowed to be more aggressive/preserve less debug info with mandatory inlined code.
Swift SVN r9339
have it remove trivially dead operands of the dead instructions. On the
same testcase as last time, this eliminates a dead metatype, getting us to:
sil @_T1t1fFT_T_ : $@thin () -> () {
bb0:
%0 = tuple ()
%1 = alloc_stack $Int64 // var a // users: %7, %6
%2 = metatype $Int64.metatype
%3 = module #Builtin
%4 = integer_literal $Builtin.Int64, 1 // user: %5
%5 = struct $Int64 (%4 : $Builtin.Int64) // user: %6
store %5 to %1#1 : $*Int64
dealloc_stack %1#0 : $*@local_storage Int64
%8 = tuple () // user: %9
return %8 : $()
}
Swift SVN r9306
Make ApplyInst and PartialApplyInst directly take substitutions for generic functions instead of trying to stage out substitutions separately. The legacy reasons for doing this are gone.
Swift SVN r8747
This is was a very mechanical patch where I basically first renamed SILNodes.def
and then just kept fixing things until everything compiled, so even though it is
large patch I feel ok(ish) with committing it.
If anyone has any concerns/etc, please email me and I will revert in 1 second.
Swift SVN r7604