Commit Graph

7 Commits

Author SHA1 Message Date
Michael Gottesman
9d32a15d39 [g-arc-opts] Teach ARC that alloc_box introduces a +1 ref count on its container.
rdar://20368790

Swift SVN r27013
2015-04-05 04:57:48 +00:00
Michael Gottesman
5da583161f [g-arc-opts] Teach ARC to recognize alloc_ref{,_dynamic} introduce objects at +1.
<rdar://problem/20368790>

Swift SVN r27004
2015-04-05 03:13:44 +00:00
Michael Gottesman
898f11f48f [g-arc-opts] Teach ARC how to recognize StrongEntrance of RC caused by @owned return values.
<rdar://problem/20368790>

Swift SVN r26999
2015-04-05 02:39:45 +00:00
Michael Gottesman
9b77fe1cb1 [g-arc-opts] Perform same refactoring for top down analysis as I performed for bottom up analysis in r26901.
Swift SVN r26906
2015-04-02 22:07:28 +00:00
Michael Gottesman
cc02b8debe [g-arc-opts] Refactor out bottomup dataflow instruction initialization into a new visitor class BottomUpDataflowRCStateVisitor.
This allows for the state transition kind caused by an instruction to change how
we process it. It also decouples this effect from the actual CFG visiting code.

This will give us the flexibility to teach the ARC optimizer in a clean way
about many more types of instructions.

Swift SVN r26901
2015-04-02 21:16:20 +00:00
Michael Gottesman
d808d6a7df [g-arc-opts] Extract out the definition of RCStateTransitionKind into a .def file.
This is apart of the work to change ARC so that all of the dataflow operations
are delegated to visitors which allow for behavior to be specialized depending
on the transformation kind. This will allow for users to add new behavior to the
ARC optimizer will minimally touching the actual dataflow.

Swift SVN r26777
2015-03-31 20:26:58 +00:00
Michael Gottesman
9816e25dd1 [arc] Add RCStateTransition.
An RCStateTransition is (you guessed it) a transition in the state
of an RCIdentity. It abstracts operations such as:

1. The introduction of a new incremented RCID by an argument (and in
the future
an @owned return value).
2. Strong increment of an RC.
3. Strong decrement of an RC.

I will use this to move pin_removal into the ARC optimizer and will
open up the ARC optimizer to being able to match up unowned values in the
future. It additionally allows me to deduplicate code from
{TopDown,BottomUp}RefCountState into RefCountState, RCStateTransition.

Swift SVN r26608
2015-03-26 22:31:39 +00:00