Commit Graph

23 Commits

Author SHA1 Message Date
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
Michael Gottesman
9e692a5304 Fix format mistakes that snuck in (Sorry!).
Swift SVN r26605
2015-03-26 22:31:38 +00:00
Michael Gottesman
52ec89a4ad [arc] Refactor out all BBState management from the evaluator into an ARCBBStateInfo class in GlobalARCSequenceDataflow.cpp. NFC.
This lets me hide a bunch of state in GlobalARCSequenceDataflow.h.

Swift SVN r26588
2015-03-26 10:40:52 +00:00
Michael Gottesman
876ad89f30 [arc] Move RefCountState's implementation into its own file. NFC.
ALso renamed the header ReferenceCountState.h => RefCountState.h since it
matches the name of the class now.

Swift SVN r26587
2015-03-26 09:17:50 +00:00
Michael Gottesman
a134e3ffee Remove preallocated map. NFC.
This was an experiment that did not work out.

Swift SVN r26584
2015-03-26 08:46:50 +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
Joe Groff
ea65d1e60b SIL: Remove the builtin_function_ref instruction.
Swift SVN r22797
2014-10-16 16:18: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
764237d226 [g-arc-opts] Cleanup dataflow merging in the ARC optimizer so we do not prematurely clear values due to spurious merge failures.
Swift SVN r21113
2014-08-08 19:35:53 +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
3fd80b868e [g-arc-opts] Add in a comment to a method. NFC.
Swift SVN r19261
2014-06-26 22:18:48 +00:00
Michael Gottesman
509bbe53be [g-arc-opts] Ignore trap BB during Sequence Dataflow.
These trap BBs are pattern matched very strictly, i.e. only BBs of the
following form are matched:

bbN:
  %_ = builtin_function_ref "int_trap"
  apply %_
  unreachable

Such BBs can be ignored safely for ARC purposes. This allows us to
handle -O3 code in the ARC optimizer significantly more effectively by
enabling us to handle many more types of check failures.

For instance we can now remove retains, releases in the following code:

bb0:
  strong_retain %0
  cond_br _, bb1, bb2

bb1:
  strong_release %0
  ...

bb2:
  %_ = builtin_function_ref "int_trap"
  apply %_
  unreachable

rdar://17212610

Swift SVN r18817
2014-06-12 00:43:11 +00:00
Michael Gottesman
c8ac91e4c7 Remove trailing whitespace that snuck in. NFC.
Swift SVN r18763
2014-06-09 23:31:35 +00:00
Michael Gottesman
59c89e56ce [g-arc-opts] Change Global ARC Sequence Dataflow to use PreallocatedMap.
This will speed up the optimizer by reducing the amount of allocations
we perform while running the optimizer.

Swift SVN r18762
2014-06-09 23:09:04 +00:00
Michael Gottesman
125c206d3b Move BlotMapVector -> include/swift/Basic/BlotMapVector so it can be used in SILAnalysis and SILPasses. NFC.
Swift SVN r18736
2014-06-07 22:20:26 +00:00
Michael Gottesman
bf47d48831 [g-arc-opts] Hoist out F.size() and enable BB numbering only if asserts (i.e. logging) is enabled.
<rdar://problem/17181185>

Swift SVN r18725
2014-06-06 03:45:35 +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
e9061373f7 [g-arc-opts] Remove old entry point to the sequence dataflow. Now this is run via the evaluator class.
Swift SVN r18723
2014-06-06 03:45:32 +00:00
Michael Gottesman
649886b142 [g-arc-opts] Add a comment to clarify the purpose of BBToPostOrderID.
This map is just for debugging purposes to give BBs an id # that is easy to
track in the debug output.

Swift SVN r18714
2014-06-05 22:20:43 +00:00
Michael Gottesman
5b3e77e622 [g-arc-opts] Implement the traversal of the RPOT, POT, forgetting all tracked instructions at loop boundaries.
<rdar://problem/17013194>

Swift SVN r18692
2014-06-01 23:03:52 +00:00
Michael Gottesman
25803adbb4 [g-arc-opts] Refactor ARCBBState from GlobalARCSequenceDataflow.cpp -> *.h.
Swift SVN r18690
2014-06-01 22:22:24 +00:00
Michael Gottesman
80f8b1a4ea [g-arc-opts] Extract out the dataflow from GlobalARCPairingAnalysis =>
GlobalARCSequenceDataflow. Add in the code to implement the bottom up
dataflow, but don't wire it up. Pass in the refactored top down dataflow
to the old pairing pass so we still give correct results.

The next step is to change the pairing analysis to use both the bottom
up and top down dataflow passes.

rdar://16965332

Swift SVN r18551
2014-05-22 02:17:28 +00:00