Commit Graph

23 Commits

Author SHA1 Message Date
Mark Lacey
64af0798df Rename members and interfaces of the call graph for clarity.
Small clean-up to try to improve on the clarity of the call graph code.

I think this is an overall improvement although there is still some
clunky naming that could be improved in the future.

Swift SVN r25492
2015-02-24 00:08:19 +00:00
Mark Lacey
f92d70ec6c Use arena allocation in the call graph builder.
Shave a little more time off the call graph construction.

Thanks go to Erik for the suggestion.

Swift SVN r25439
2015-02-20 22:41:55 +00:00
Mark Lacey
a842e35810 Reapply "Handle thin_to_thick_function in call graph construction."
Reapply r24765 with small tweak to comment. This was reverted in r24766.

It turns out that this particular change does not interfere with any
assumptions made in the function signature optimization pass.

Swift SVN r24804
2015-01-28 20:21:45 +00:00
Mark Lacey
6c9e9ad1cd Use the set of known callees in building the call graph.
NFC since we're only building the call graph from function_refs now, and
thus we know we always have a complete set of callees (exactly one).

Swift SVN r24792
2015-01-28 06:25:02 +00:00
Mark Lacey
7ca8777b45 Revert "Handle thin_to_thick_function in call graph construction."
This reverts commit r24765.

There might be an issue with some of the clients of the call graph
making assumptions that this change invalidates.

Swift SVN r24766
2015-01-28 00:51:00 +00:00
Mark Lacey
626082776c Handle thin_to_thick_function in call graph construction.
Swift SVN r24765
2015-01-28 00:37:39 +00:00
Mark Lacey
f8d9f73777 Refactor call graph to share common code for different kinds of applies.
Swift SVN r24764
2015-01-28 00:37:38 +00:00
Mark Lacey
9be5c4aa71 Minor update to call graph interface.
Provide only a single way to create a call graph edge, and make the
client explicitly inform us whether the callee set is complete.

Swift SVN r24763
2015-01-28 00:37:38 +00:00
Michael Gottesman
a4318845cc Add in a few comments. NFC.
Swift SVN r23717
2014-12-05 02:08:38 +00:00
Michael Gottesman
ebfcc123a3 [callgraph] Teach the callgraph how to determine for simple cases if we have a complete caller set.
We specifically only handle cases of functions that are not visible externally
and for whom all function_refs to the function only have apply inst users.

<rdar://problem/19137435>

Swift SVN r23714
2014-12-05 02:08:36 +00:00
Andrew Trick
fd7c8d5627 Silence unused variable warnings.
Swift SVN r23346
2014-11-15 01:10:27 +00:00
Joe Groff
ea65d1e60b SIL: Remove the builtin_function_ref instruction.
Swift SVN r22797
2014-10-16 16:18:40 +00:00
Joe Groff
e3f9a2035c SIL: Move SILGen and passes over to use "builtin" instead of "apply (builtin_function_ref)".
Swift SVN r22785
2014-10-15 23:37:22 +00:00
Joe Groff
3a606b9eb8 SIL: Drop the protocol_method instruction.
Swift SVN r22446
2014-10-01 23:35:41 +00:00
Mark Lacey
cf747b7398 Fix issue with SCCs getting added to the call graph multiple times.
Don't create the SCC finder for each root - we end up losing the state
of what we've already visited.

Swift SVN r21569
2014-08-29 08:08:32 +00:00
Mark Lacey
6a695f3099 Move DeadFunctionElimination to using the new call graph.
The old call graph remains, but the new call graph can obtained by
calling getCallGraph() on the analysis pass.

I'll move the few other passes that use the call graph over soon and
then rip out the old call graph.

No diffs in the stdlib.

Swift SVN r21565
2014-08-29 05:03:31 +00:00
Mark Lacey
52cf2f4da2 Don't add declarations as call graph roots.
Swift SVN r21554
2014-08-29 00:32:18 +00:00
Mark Lacey
36365d79df In the new call graph, find the SCCs in bottom-up order.
With this change we generate the SCCs in the call graph (for the kinds
of calls we currently recognize) in bottom-up, which we can then
iterate over directly or in reverse for invocation- and
reverse-invocation-order traversal of the call graph.

(This still isn't hooked up - but will be after some dumping routines
and verification of the output).

Swift SVN r21552
2014-08-29 00:32:17 +00:00
Mark Lacey
3494d6ab39 Track call graph roots with a SmallVector rather than DenseSet.
This will allow us to search in the order the roots are added which
should improve stability of our output. There is also an ordinal on each
node that we can use to choose order of traversing edges at a given call
site.

Swift SVN r21484
2014-08-27 16:59:50 +00:00
Mark Lacey
dee10cb164 Update the new call graph so that edges have sets of call graph nodes.
Previously we tracked a set of functions that could be called from a given
call site. Now we track a set of call graph nodes (each of which
represents a callable function). As a result we now create call graph
nodes for declarations rather than just definitions.

Swift SVN r21483
2014-08-27 15:54:34 +00:00
Mark Lacey
2719a13114 Add statistic to call graph builder for calls to builtins.
Add a statistic to the new call graph to track calls to builtins (for
which we do not have a call graph node or edge).

Swift SVN r21465
2014-08-26 21:53:08 +00:00
Mark Lacey
a3350db69c Add statistics to call graph construction.
Also stub out some of the cases we'll need to handle to build a more
complete call graph.

Swift SVN r21430
2014-08-23 05:48:54 +00:00
Mark Lacey
34a1050222 Add data structures for a new, more detailed, call graph.
This is not yet hooked up. I want to add a dumper and some tests, and
need to implement code to do invocation- and reverse-invocation-ordering
over the SCCs of the call graph before it can fully replace the existing
code.

This call graph has edges for each call site, so it's really a
multigraph. Each call site tracks the set of functions that can be
called from that point. Currently that set is always a singleton since
we only handle applies of direct function_refs (like the existing call
graph). In time it will be expanded to handle other types of function
application.

Swift SVN r21407
2014-08-22 07:46:53 +00:00