The old invalidation lattice was incorrect because changes to control flow could cause changes to the
call graph, so we've decided to change the way passes invalidate analysis. In the new scheme, the lattice
is replaced with a list of traits that passes preserve or invalidate. The current traits are Calls and Branches.
Now, passes report which traits they preserve, which is the opposite of the previous implementation where
passes needed to report what they invalidate.
Node: I tried to limit the changes in this commit to mechanical changes to ease the review. I will cleanup some
of the code in a following commit.
Swift SVN r26449
Array.init does not have a self argument (it returns the newly created array
@owned). Passes using the ArraySemantic::getSelf() interface must handle it
specially.
rdar://19724033
Swift SVN r25013
We can skip address projections when looking for a call to _getElementAddress.
This allows us to recognize more harmless (stores that don't effect the array
size) stores that just store to elements in the array.
Swift SVN r23650
To guarantuee memory safety we need to guarantuee that the deinit method can not
do anything unsafe. This means we need to treat general releases like any
arbitrary function call. We need to assume it does something unsafe.
Conservatively, we only releases on arrays are known to be safe.
Thanks Andy for pointing this out to me!
Swift SVN r23181
without a valid SILDebugScope. An assertion in IRGenSIL prevents future
optimizations from regressing in this regard.
Introducing SILBuilderWithScope and SILBuilderwithPostprocess to ease the
transition.
This patch is large, but mostly mechanical.
<rdar://problem/18494573> Swift: Debugger is not stopping at the set breakpoint
Swift SVN r22978
Fixes an embarrassing mistake. I am used to saying something is loop invariant
if it dominates the loop header. What I really mean of course, is that it
strictly dominates the loop header.
Unfortunately, I actually wrote code that checks dom(invariant?, header). :(
rdar://18498770
Swift SVN r22393
This encapsulates common operations on array semantic calls like identifying
them or hoisting/copying them.
Will be used by follow-up commits. NFC.
Swift SVN r21926
Currently, the pass just calls a local version of that function. After OzU, I
will enable the full pass (which is currently disabled behind a flag).
Swift SVN r21894
This follows the model of dominance info and allows me to create reachability
methods on SILBasicBlock without creating dependencies from swiftSIL to
swiftSILAnalysis.
Swift SVN r21866
After stripRCIdentityPreservingOps the indirection through the array buffer data
structure is gone. We would no longer recognize a matching retain.
Where we had this before:
%3 = load %0 : $*ArrayInt
%4 = struct_extract %3 : $ArrayInt, #ArrayInt.buffer
%5 = struct_extract %4 : $ArrayIntBuffer, #ArrayIntBuffer.storage
retain_value %5 : $Builtin.NativeObject
subscript_check(%3, i)
We now would just have:
%3 = load %0 : $*ArrayInt
retain_value %3 : $
subscript_check(%3, i)
Swift SVN r21512
We can now hoist the check in:
for (i = start; i != end; ++i)
a[i] = ...
or
for i in start ..< end
a[i] = ...
We will also hoist invariant checks as in
k =
for i in start ..< end
a[k] = ...
We will also hoists the overflow check for "++i" out of the loop.
The only thing blocking vectorization of memset loops is the fact that we are
overflow checking the type size muliplication of array accesses. "a[i]" is
translated to "a + sizeof(T) * i" and this multiplication is still overflow
checked.
We can remove bounds checks in PrimeNum, XorLoop, Hash, MemSet, NBody, Walsh.
Memset , 2371.00 , 1180.00 , 1179.00 , 99.9%
XorLoop , 1403.00 , 1255.00 , 149.00 , 11.9%
rdar://14757945
Swift SVN r21182
Implements redundant bounds check elimination for basic blocks and along the
dominator tree of loops.
No induction variable based hoisting yet.
O3:
NBody , 473.00 , 122.00 , 294.2%
QuickSort , 477.00 , 310.00 , 53.9%
RC4 , 1022.00 , 736.00 , 38.6%
Walsh , 1781.00 , 1142.00 , 55.5%
No effect on Ofast.
Disabled for now.
Swift SVN r20199