Commit Graph

19 Commits

Author SHA1 Message Date
Nadav Rotem
e8bbace5e1 [SideEffectsAnalysis] Cleanups some code.
Abbreviate SILInstruction::MemoryBehavior and rewrite one of the loops.
2015-11-24 15:52:51 -08:00
Mark Lacey
19b7554cf2 Use the new function order helper in side effect analysis.
Rather than using the call graph's bottom-up ordering, use the new helper.
2015-11-19 07:17:05 -08:00
Nadav Rotem
cc2ca083ee Change the bool that represents the property of observing or ignoring retains in Alias Analysis into an enum.
We had a true/false bug in this flag. Let's not have another bug with this flag.
2015-11-18 17:02:27 -08:00
Nadav Rotem
cdb8e1d13e Shorten some of the names in SideEffectsAnalysis 2015-11-18 16:02:38 -08:00
Erik Eckstein
d2d6e0cbe8 Re-apply "Update SideEffectAnalysis to use BasicCalleeAnalysis.""
... and re-enable the cse_apply test.
The underlying problem is fixed in LICM in the previous commit.

Original commit: 02e08e23de.
2015-11-18 15:06:50 -08:00
Erik Eckstein
02e08e23de Revert "Update SideEffectAnalysis to use BasicCalleeAnalysis."
This reverts commit ffddffc06d.

It triggers a miscompile in the benchmarks.
In addition I had to disable the cse_apply.sil test.
2015-11-18 11:08:53 -08:00
Mark Lacey
ffddffc06d Update SideEffectAnalysis to use BasicCalleeAnalysis.
This is one step towards removing the full call graph. In the process it
removes a bit of brittleness around side effect analysis queries which
previously may or may not have returned the most conservative result
depending on whether we already had a valid call graph constructed.
2015-11-17 01:17:53 -08:00
Mark Lacey
5c820508fa Begin to generalize call graph for non-apply instructions.
We need to be able to support non-apply instructions that result in
calling things like deinits. This is the first mechanical pass of
converting interfaces and data over.
2015-11-04 08:17:23 -08:00
Erik Eckstein
e08d1b37d2 Fix a memory leak in SideEffectAnalysis.
Thanks to Arnold and Roman for investigating a memory problem, which was completely unrelated but
caused enough panic on my side to find this one :-)



Swift SVN r32956
2015-10-28 23:52:49 +00:00
Mark Lacey
73098dfa6d Rename canCallArbitraryFunction to canCallUnknownFunction.
Swift SVN r32749
2015-10-18 22:22:37 +00:00
Mark Lacey
25abe9d750 Refactor and improve the representation of sets of callees.
There is now a separate class to abstract the notion of a set of
callees. The class itself is very compact - always a pointer in size,
but distinguishes singleton callees, true sets of callees, and in the set
case whether that set is incomplete. The sets are cached in the call
graph as before, but that cache now caches whether the sets are
incomplete or not, which will enable correctly computing and caching
that information for method calls so that the call graph can correctly
represent whether those are known to be incomplete sets, or whether we
really know all the possible callees at a call site.

This also hides more implementation details of the call graph, and
provides a new interface getCallees() which provides a way to iterate
over the SILFunctions rather than CallGraphNodes.

More clean-up and refactoring coming in future commits.

Swift SVN r32737
2015-10-17 00:11:13 +00:00
Mark Lacey
94ddaf22b9 Remove the getComplete* functions from call graph.
Rename the getPartial* functions to get* in each case.

The intent in splitting these into two APIs was to catch bugs, but it
adds complexity without really adding much safety since a client could
call getPartial* and treat the results as if they are complete.

Swift SVN r32685
2015-10-14 21:32:57 +00:00
Mark Lacey
c269f9c821 Add more entrypoints to CallGraph to hide implementation details.
Swift SVN r32590
2015-10-10 04:06:46 +00:00
Mark Lacey
2c1d94db1c Hide some more implementation details of the call graph.
Add one of the queries returning call sites of callers of a function
into the CallGraph proper.

Another of many refactoring steps on the way. NFC.

Swift SVN r32589
2015-10-10 04:06:45 +00:00
Nadav Rotem
7c1e5236a7 Refactor the code that checks for owned parameters. NFC.
Swift SVN r32478
2015-10-06 23:53:55 +00:00
Dave Abrahams
b1e98fe3e1 [stdlib] Array refactoring: s/NoTypeCheck/TypeChecked/
First in a long series of commits to clean up the array implementation
and make it maintainable by the stdlib team.

Swift SVN r32311
2015-09-29 22:38:56 +00:00
Erik Eckstein
a0f670b8bd Add getMemBehavior utility functions to SideEffectAnalysis.
Swift SVN r32169
2015-09-23 00:26:40 +00:00
Erik Eckstein
524a6f90dd SideEffectAnalysis: avoid recomputing the call graph whenever it is not there.
This avoids quadratic complexity if a function pass does invalidate the call graph.
(which should not happen anyway, but this is another issue).



Swift SVN r31993
2015-09-16 16:40:57 +00:00
Erik Eckstein
ff7da42e8b A first version of the side-effects analysis.
It provides side-effect information for functions, e.g. does it write to memory, etc.
For details see the comments in SideEffectAnalysis.h

With this commit, the side-effect analysis is just computed but not used anywhere yet.
So, regarding the generated code it is NFC.



Swift SVN r31951
2015-09-15 00:16:33 +00:00