Commit Graph

27 Commits

Author SHA1 Message Date
Nadav Rotem
50803a7653 Create FunctionAnalysisBase to handle the boiler plate of caching and invalidating function specific analysis.
Swift SVN r26642
2015-03-27 20:54:22 +00:00
Nadav Rotem
f0fa502d56 Split the RCIdentityAnalysis analysis to allow per-function invalidation.
Before the change the RCIdentityAnalysis kept a single map that contained
the module's RC information. When function passes needed to invalidate the
analysis they had to clear the RC information for the entire module. The
problem was mitigated by the fact that we process one function at a time, and
we start processing a new function less frequently.

II adopted the DominanceAnalysis structure. We should probably implement
this functionality as CRTP.

Swift SVN r26636
2015-03-27 16:55:36 +00:00
Nadav Rotem
d78b376d07 [passes] Replace the old invalidation lattice with a new invalidation scheme.
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
2015-03-23 21:18:58 +00:00
Joe Groff
7f886c924b SIL: Make 'isReferenceCounted' a bit on TypeLowering.
This allows types to be lowered as scalar reference-counted types without requiring them to have AST-level reference semantics. For now, put in a staging assertion to ensure isReferenceCounted == hasReferenceSemantics to make sure we set the bit properly everywhere.

Swift SVN r26238
2015-03-17 21:51:06 +00:00
Michael Gottesman
494305dcd1 Revert "Remove sil option flags that are no longer needed."
This reverts commit r25828. I forgot that some tests depend on these. Thanks
Andy!

Michael

Swift SVN r25832
2015-03-07 03:10:15 +00:00
Michael Gottesman
e40f01c9ed Remove sil option flags that are no longer needed.
Swift SVN r25828
2015-03-07 02:31:52 +00:00
Dmitri Hrybenko
61286f0260 Fix warnings produced by a newer version of Clang
Swift SVN r25257
2015-02-12 23:50:47 +00:00
Michael Gottesman
39817d5fd8 Remove arc namespace.
Swift SVN r24500
2015-01-19 00:10:48 +00:00
Michael Gottesman
7a2e1fb4d3 [arc-opts] After the arc optimizer converges, run another round of the ARC
optimizer freezing releases in the epilogue of functions that match to
SILArguments. This allows us to treat all such SILArguments throughout the
entire function as having a post dominating release.

<rdar://problem/18923030>

Swift SVN r23253
2014-11-11 23:37:09 +00:00
Adrian Prantl
c41b30299f Audit all SILPasses to ensure that new instructions are never created
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
2014-10-28 01:49:11 +00:00
Erik Eckstein
7573d42fe1 Fix checks for globalinit_* functions.
I missed this in my commit r22795: Mangle names of globalinit_{token,func} like other private entities.



Swift SVN r22839
2014-10-20 13:47:40 +00:00
Michael Gottesman
4609513593 Remove SILValue::stripRCIdentityPreservingArgs and teach all uses of that method to use the new RCIdentityAnalysis.
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
2014-09-11 22:29:31 +00:00
Michael Gottesman
e998695670 [g-arc-opts] Refactor global arc opts to use the PostOrderAnalysis.
Swift SVN r19915
2014-07-14 01:32:27 +00:00
Michael Gottesman
801a9290ef Add in comments to GlobalARCOpts.cpp. NFC.
Swift SVN r19886
2014-07-13 00:39:28 +00:00
Michael Gottesman
98649dada2 [global-arc-opts] It is not expected, but just in case we get more than INT_MAX BB, bail gracefully.
Swift SVN r19260
2014-06-26 22:18:44 +00:00
Michael Gottesman
81f5fdc8a7 [g-arc-opts] Change Global ARC Opts to respect the EnableARCOptimization flag.
Swift SVN r19129
2014-06-24 06:30:05 +00:00
Michael Gottesman
0cd44d174f [g-arc-opts] Only run the ARC optimizer on functions that contain reference count instructions that we care about.
This shaves off another second or so from the runtime of swift on bst.swift.

<rdar://problem/17181185>

Swift SVN r18727
2014-06-06 03:45:37 +00:00
Michael Gottesman
a12fb013f7 [g-arc-opts] Create a context object for the matching set computation which stores an evaluator and both state maps. This allows us to not need to recompute the reverse post order over and over again for a single function.
<rdar://problem/17181185>

Swift SVN r18724
2014-06-06 03:45:34 +00:00
Michael Gottesman
814274a05d Make some logging easier to read. NFC.
Swift SVN r18704
2014-06-05 04:35:10 +00:00
Michael Gottesman
2972dc38b2 [g-arc-opts] When creating increments, decrements do not use the SILLocation of the insertion point. If the insertion point is a terminator instruction, the increment, decrement will get a SILLocation that is not valid on non-terminator instructions which will cause an assertion to be hit.
I am going to speak with Adrian in the coming week about what is the
correct thing to do here.

Swift SVN r18691
2014-06-01 22:22:24 +00:00
Michael Gottesman
1b907dce9a [g-arc-opts] Remove excessive indentation from DEBUG messages.
I don't know why I put in those two extra new lines. *sigh*.

Swift SVN r18688
2014-06-01 22:22:23 +00:00
Michael Gottesman
445c474ed0 [g-arc-opts] Wired up the Release->RetainState (TDMap), Retain->ReleaseState (BUMap) dataflow into the pair matcher analysis which matches up sets of retains, releases.
This completes the implementation of the bottom up decrement data flow
data analysis.

<rdar://problem/16965332>

Swift SVN r18580
2014-05-23 01:34:13 +00:00
Michael Gottesman
592c2bb265 [g-arc-opts] Move the ARC pairing and dataflow analysis into their own analysis file.
Now the actual GlobalARCOpts pass itself is complete. The rest of the
work is improving the analysis.

rdar://16965332

Swift SVN r18542
2014-05-22 00:58:34 +00:00
Michael Gottesman
dba7b24a97 [g-arc-opts] Transpose the execution from processing a set of reference
counts a basic block at a time many times to processing a set of
reference counts on a function many times.

Now we have the final API for the analysis side of ARC, the API user
gets back:

1. The pointer being tracked.
2. A set of increments.
3. A set of decrements.
4. A set of increment insertion points.
5. A set of decrement insertion points.

<rdar://problem/16965332>

Swift SVN r18539
2014-05-22 00:35:45 +00:00
Michael Gottesman
8641f5bab0 [global-arc-opts] Separate the increment, decrement matching function from the function that actually removes, moves the increments, decrements.
Now that this is done, I will begin to extract the dataflow
analysis/pairing into an analysis.

<rdar://problem/16965332>

Swift SVN r18480
2014-05-21 05:29:17 +00:00
Michael Gottesman
97107d3266 Fix variable name typo. NFC.
Swift SVN r18443
2014-05-20 03:21:42 +00:00
Michael Gottesman
24d98ce926 [global-arc-opts] Copy current single basic block ARCOpts -> GlobalARCOpts in preparation for beginning multiple basic block ARC work.
This will allow me to hide this work behind a flag when the time comes
so that other people's work is not disrupted.

rdar://16965332

Swift SVN r18437
2014-05-19 22:56:01 +00:00