File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
include/swift/SILOptimizer/Analysis Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,18 @@ class CallerAnalysisFunctionInfo {
51
51
friend class CallerAnalysis ;
52
52
};
53
53
54
+ // / CallerAnalysis relies on keeping the Caller/Callee relation up-to-date
55
+ // / lazily. i.e. when a function is invalidated, instead of recomputing the
56
+ // / function it calls right away, its kept in a recompute list and
57
+ // / CallerAnalysis recomputes and empty the recompute list before any query.
58
+ // /
59
+ // / We also considered the possibility of keeping a computed list, instead of
60
+ // / recompute Every time we need to complete the computed list (i.e. we want
61
+ // / to the computed list to contain every function in the module). We need to
62
+ // / walk through every function in the module. This leads to O(n) And we need
63
+ // / to run every function through the a sequence of function passes which might
64
+ // / invalidate the functions and make the computed list incomplete. So
65
+ // / O(n) * O(n) = O(n^2).
54
66
class CallerAnalysis : public SILAnalysis {
55
67
56
68
// / Current module we are analyzing.
You can’t perform that action at this time.
0 commit comments