Commit Graph

111 Commits

Author SHA1 Message Date
Dmitri Hrybenko
850ab19115 Avoid using libc++ extension for tuples
Swift SVN r23636
2014-12-03 03:39:02 +00:00
Michael Gottesman
6d61aad42e [proj] Add a new data structure called a "Projection Tree".
A "Projection Tree" takes in a type and constructs a tree where each non-leaf
node represents an aggregate that can be split up and all leaf nodes represent a
subtype of the original type that we can not split.

It additionally provides the capability to propagate usage information
and liveness information through the tree, making it trivial to perform
SROA + partial dead use elimination. I am using this in function
signature opts for that purpose.

Swift SVN r23586
2014-11-28 20:38:55 +00:00
Michael Gottesman
6c29301490 Fix a stale comment.
Swift SVN r23389
2014-11-17 23:02:46 +00:00
Michael Gottesman
2d703a28f5 [proj] Add Projection::create{Addr,Value}Projection so one can create Projections without knowing what the internal state of the projection is.
Swift SVN r23371
2014-11-17 17:52:16 +00:00
Michael Gottesman
eeab468c8e [proj] Prepare Projection so that I can add generic create{Addr,Value}Projection.
I want to cleanup some code paths in SILCombine and LoadStoreOpts to use
generic create{Addr,Value}Projection methods which create the
appropriate projection instruction for a Projection method. Also this
will allow me to start to hide more of the internal state of Projection.

Swift SVN r23366
2014-11-17 06:43:37 +00:00
Michael Gottesman
a4a633351f [projection] Make projection constructors private and create static failable initializers using Optional.
This changes the Projection API so that you pass in an instruction and get back
an optional depending on what theinstruction was. This is much cleaner than
always needing to do a switch.

This commit also cleans up the naming in Projection so that we always use the
term "value projection" for struct_extract, tuple_extract, and
unchecked_enum_data instead of the term "extract". This lines up better with the
name we use for the *_addr instructions, "address projection" and avoids
ambiguity since unchecked_enum_data does not have the word "extract" in it.

Additionally by adding in the failable initializers, my centralization of the
initialization logic enables me to ensure that isAddrProjection and
isValueProjection stay in sync with the various constructors via asserts. This
should prevent future bugs if we add additional notions of "projection".

Swift SVN r23356
2014-11-16 04:09:16 +00:00
Michael Gottesman
7285835422 [projection] Rename isAddressProjection => isAddrProjection and add isValueProjection.
This is apart of some cleanups of the Projection class.

I also improved the comment at the top of projection to make its usage
clearer.

Swift SVN r23355
2014-11-16 04:09:15 +00:00
Michael Gottesman
3ae10834d6 [ls-opts] Teach LoadStoreOpts how to forward smaller previous loaded items to the uses of larger later loads that partially alias the load.
This will help the ARC optimizer given future function sig optimization work and
is in general good since this has been a hole in our load store forwarding for a
while.

rdar://18831605

Swift SVN r23102
2014-11-04 19:44:06 +00:00
Michael Gottesman
01a00347ca [aa] Add ProjectionPath::computeSubSeqRelation() and use it to teach AA how to check for partial aliasing.
rdar://18831605

Swift SVN r23076
2014-11-03 03:38:01 +00:00
Michael Gottesman
bb48674cf3 [aa] Move address projection path AA to use projection path infrastructure.
rdar://18831605

Swift SVN r23061
2014-11-02 00:41:13 +00:00
Michael Gottesman
596f406f31 [aa] Refactor all projection path logic into a class called ProjectionPath.
rdar://18831605

Swift SVN r23060
2014-11-02 00:41:13 +00:00