Commit Graph

4 Commits

Author SHA1 Message Date
Michael Gottesman
ac55558ba6 [g-arc-opts] Teach ARC how to recognize insts that *must* (notice not
may) use a value and that we will not remove implying that the use will
keep the value alive.

rdar://20368790

Swift SVN r27010
2015-04-05 04:31:41 +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