Commit Graph

12 Commits

Author SHA1 Message Date
Mark Lacey
ea2cbffb31 Remove IgnoreMissing parameter from removeEdgeForApply().
Instead, add a removeEdge() and update code to use
getCallGraphEdge()/removeEdge() in cases where the apply may not be
represented in the call graph.

Swift SVN r26881
2015-04-02 18:59:18 +00:00
Mark Lacey
23b6bd84f6 Do not build the call graph just to maintain it.
Before this commit, passes that were attempting to maintain the call
graph would actually build it if it wasn't already valid, just for the
sake of maintaining it.

Now we only maintain it if we already had a valid call graph built.

Swift SVN r26873
2015-04-02 17:16:01 +00:00
Ted Kremenek
69a12dfcb8 Revert "stdlib: Do the Array fast-path check with a single array property call."
This was causing test '1_stdlib/ArrayTraps.swift.gyb' to fail.

Swift SVN r26872
2015-04-02 14:47:19 +00:00
Erik Eckstein
834645a901 stdlib: Do the Array fast-path check with a single array property call.
Now that we can check isNative and NoDTC (no deffered type check needed) with a single bit-mask operation,
it makes sense to have a single array property call for it.
I replaced the the semantics call array.props.needsElementTypeCheck with array.props.isNativeNoDTC,
which is the combination of isNative && !needsElementTypeCheck. I kept array.props.isNative, which is not used for now,
but might be useful in the future, e.g. for array operations which don't care about type checks.

The optimized SIL for a class array access arr[i] now contains the minimum of 4 basic blocks.
PerfTests show +25% for DeltaBlue and some improvemements for -Onone.



Swift SVN r26871
2015-04-02 14:10:54 +00:00
Michael Gottesman
2dc936bd27 Remove code that snuck in.
Swift SVN r26864
2015-04-02 05:39:39 +00:00
Michael Gottesman
b122c0da47 [array-semantics] Teach array semantics to update the CallGraph when deleting instructions.
Swift SVN r26859
2015-04-02 05:01:09 +00:00
Michael Gottesman
2c1aed9b27 [cow] Teach uniqueness check hoisting how to ignore guaranteed calls to ArraySemantic functions.
We ignore calls to ArraySemantic functions when we hoist uniqueness checks. With
+0 self, this is disrupted by the release that now is in the caller instead of
the callee.

This patch fixes that problem by teaching COWArrayOpts about "guaranteed call
sequences". This is the following pattern:

retain(x)
... nothing that decrements reference counts ...
call f1(@guaranteed_self x)
... nothing that decrements or uses ref counts ...
call f2(@guaranteed_self x)
... nothing that decrements or uses ref counts ...
...
... nothing that decrements or uses ref counts ...
call f$(n-1)(@guaranteed_self x)
... nothing that decrements or uses ref counts ...
call fn(@guaranteed_self x)
... nothing that uses ref counts ...
release(x)

This pattern is created when there are a bunch of guaranteed calls together in a
row (which seems to happen at the "semantic" SIL level). We pattern match the
sequence and then verify that all of the calls are semantic calls. If the
verification succeeds, we can hoist the uniqueness check.

rdar://20340699

Swift SVN r26835
2015-04-01 23:30:03 +00:00
Michael Gottesman
74777a6c3a [remove-pin] Teach remove pin how to recognize a safe guaranteed array semantic call sequence.
Given a strong_pin for which we have not yet seen a strong_unpin, a safe
guaranteed call sequence is of the following form:

retain(x)
call f(@guaranteed x)
release(x)

where f is an array semantic call that we know does not touch globals and thus
are known to not change ref counts.

rdar://20305817

Swift SVN r26662
2015-03-28 00:43:47 +00:00
Arnold Schwaighofer
63f4170a0e ArraySemantics: To facilitate make_unique hoisting add a array.owner call
After this change we can also hoist uniqueness checks for array of classes.

rdar://19955624

Swift SVN r26311
2015-03-19 19:32:16 +00:00
Arnold Schwaighofer
513df867cf Revert "ArraySemantic: Add isMayRelease method"
This reverts commit r25925.

We cannot assume that these functions are not mayRelease because they call
Objective C functions which we must assume to be mayRelase.

Swift SVN r26107
2015-03-13 18:55:05 +00:00
Arnold Schwaighofer
fab9212e45 ArraySemantic: Add isMayRelease method
Returns whether this array semantic call has a neutral effect on reference
counts.

Swift SVN r25925
2015-03-10 15:20:21 +00:00
Arnold Schwaighofer
aa24e126e4 ArraySemantic: Move to its own file in SILAnalysis
I want to use it in ARCAnalysis.

Swift SVN r25924
2015-03-10 15:20:20 +00:00