constructor in SILBasicBlock::createArgument.
By default the argument is nullptr so any place that currently does not
need to pass in the ValueDecl will not need to be updated given the new
behavior.
Swift SVN r22379
In a loop like this:
var j = 2
for var i = 0; i < 100; ++i {
j += 3
}
it will completely eliminate j.
It does not yet support rewriting conditional branches as unconditional
branches in the cases where only empty blocks are control dependent on
an edge. Once this support is added, it will also completely eliminate
the loop itself.
Swift SVN r18615
If we have BB args that are only used in a struct/tuple extract, and
that are generated in each predecessor with a struct/tuple instruction,
retype the BB arg and replace the argument with what would have been the
extracted value.
This provides more opportunties for jump threading to kick in.
Swift SVN r16509
In cases like the one below, replace the integer_literal instructions
with the condition branching to the block that the instruction is in.
cond_br %10, bb1, bb3
bb1:
%13 = integer_literal $Builtin.Int1, -1
br bb2(%13 : $Builtin.Int1)
bb3:
%18 = integer_literal $Builtin.Int1, 0
br bb2(%18 : $Builtin.Int1)
Similarly, for
switch_enum %0 : $Bool, case #Bool.true!enumelt: bb1
bb1:
%1 = enum $Bool, #Bool.true!enumelt
we'll replace the enum with %0.
Use this functionality from within the CFG simplification pass to
simplify basic block args in an attempt to expose opportunities for
further CFG simplification.
Swift SVN r9968
Propagate/remove basic block input values when all predecessors supply
the same arguments. Another optimization needed to fold 'true'.
TODO: I need to figure out additional surcumstances in which to to trigger this
optimization and if we need to rerun CCP after this. (For example, we need to
rerun this after constant folding the terminator in order to fold 'true'.)
Swift SVN r8518
inserting a diamond into the middle of an existing block. This fixes a
problem that manifests in memory promotion when lowering an assign.
Swift SVN r7917
This was not likely an error-free change. Where you see problems
please correct them. This went through a fairly tedious audit
before committing, but comments might have been changed incorrectly,
not changed at all, etc.
Swift SVN r7631
Remove uncurry level as a property of SILType/SILFunctionTypeInfo. During SIL type lowering, map a (Type, UncurryLevel) pair to a Swift CanType with the uncurried arguments as a Swift tuple. For example, T -> (U, V) -> W at uncurry level 1 becomes ((U, V), T) -> W--in reverse order to match the low-level calling convention. Update SILGen and IRGen all over the place for this representation change.
SILFunctionTypeInfo is still used in the SILType representation, but it's no longer load-bearing. Everything remaining in it can be derived from a Swift type.
This is an ABI break. Be sure to rebuild clean!
Swift SVN r5296
type, though; I had to define a WriteAsOperand function and
add a front() method to SILFunction to get this to work.
Rip out my dominators implementation and replace it with
LLVM's. I'd forgotten that LLVM's was actually generic.
Swift SVN r4717