checkAllocBoxUses had two places where mark_uninitialized was being
processed, the second one unreachable.
The code removed by this commit was the code added later, and it makes
the assumption that the mark_uninitialized is the only use of the value
being processed. Although that assumption might be reasonable and
currently true, it's not verified.
Swift SVN r14043
Riding off of project_existential[_ref] was convenient, but the
resuls are used quite differently. Note that open_existential[_ref]
still don't print/parse reasonably yet.
Swift SVN r13878
Now the pass does not need to know about the pass manager. We also don't have
runOnFunction or runOnModule anymore because the trnasformation knows
which module it is processing. The Pass itself knows how to invalidate the
analysis, based on the injected pass manager that is internal to the
transformation.
Now our DCE transformation looks like this:
class DCE : public SILModuleTransform {
void run() {
performSILDeadCodeElimination(getModule());
invalidateAnalysis(SILAnalysis::InvalidationKind::All);
}
};
Swift SVN r13598
- purge @inout from comments in the compiler except for places talking about
the SIL argument convention.
- change diagnostics to not refer to @inout
- Change the astprinter to print InoutType without the @, so it doesn't show
up in diagnostics or in closure argument types in code completion.
- Implement type parsing support for the new inout syntax (before we just
handled patterns).
- Switch the last couple of uses in the stdlib (in types) to inout.
- Various testcase updates (more to come).
Swift SVN r13564
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