Commit Graph

77 Commits

Author SHA1 Message Date
Joe Groff
67ca7ce1e9 SIL: Rename 'protocol_metatype' to 'existential_metatype'.
It's not forming the metatype for the protocol type (exists t: P. t).metatype, it's forming the existential of a metatype of a conforming type, exists t: P. (t.metatype).

Swift SVN r14520
2014-02-28 16:14:00 +00:00
Joe Groff
88b6efcc43 Rename ArchetypeMethodInst -> WitnessMethodInst more thoroughly.
Swift SVN r14501
2014-02-28 06:41:18 +00:00
Joe Groff
9424de6787 SIL: Rename 'archetype_metatype' to 'value_metatype'.
Since it can grab a metatype from any value now.

Swift SVN r14500
2014-02-28 06:33:05 +00:00
Joe Groff
545f173507 SIL: Fold 'archetype_metatype' and 'class_metatype'.
Having one instruction to get the dynamic metatype of a (non-existential) value makes more sense from a generic specialization standpoint and should stave off inevitable crashers when archetype_metatypes get specialized. protocol_metatype remains separate because metatype existentials are more interesting.

Swift SVN r14499
2014-02-28 06:32:58 +00:00
Joe Groff
855ea99063 SIL: Combine 'archetype_ref_to_super' and 'upcast'.
We were wantonly applying 'upcast' to archetypes in some cases, and really, that's OK, since these instructions do the same thing (and generic specialization could turn archetype_ref_to_super into upcast). Make everyone's life easier by folding archetype_to_super into upcast. Fixes <rdar://problem/16192324>.

Swift SVN r14496
2014-02-28 04:33:18 +00:00
Doug Gregor
3182cd3910 Introduce thick/Objective-C metatype conversion instructions.
Introduce the SIL instructions thick_to_objc_metatype and
objc_to_thick_metatype to convert between the 'thick' and
'Objective-C' representations of a metatype. Most of this code is
trivial support code for these conversions: printing, parsing,
(de-)serialization, etc., for which testing will come online in
subsequent patches or is incidental in other tests.

Lower Objective-C metatype values down to objc_class* at the IR level
and implement IRGen support for these SIL instructions. SIL-only test
case at the moment because SILGen never creates these instructions.



Swift SVN r14087
2014-02-19 18:20:21 +00:00
Michael Gottesman
8305814733 [sil-aa] Make sure we do not use too much compile time in valueMayBeCaptured by limiting the size of the use lists we will process to 32.
Swift SVN r14040
2014-02-18 15:50:14 +00:00
Michael Gottesman
6924925bff [sil-aa] Small cleanups. NFC.
Swift SVN r14014
2014-02-17 23:41:22 +00:00
Michael Gottesman
6570c169c0 Teach SILArgument how to determine if it is a function argument or not.
A SILArgument is a function argument if the argument's parent BB is the entry BB
of the function containing the argument.

This is an interesting distinction since function arguments have special
aliasing properties with respect to indirect arguments which normal basic block
arguments do not.

Swift SVN r14012
2014-02-17 23:24:06 +00:00
Doug Gregor
2134072285 Split open_existential[_ref] out as their own instructions.
Riding off of project_existential[_ref] was convenient, but the
resuls are used quite differently. Note that open_existential[_ref]
still don't print/parse reasonably yet.



Swift SVN r13878
2014-02-13 23:42:23 +00:00
Michael Gottesman
060a6b59fa [sil-aa] Make the comment descriptor of transitive escape inst clearer and use a refactored method to determine if a builtin is read none instead of doing it manually.
Swift SVN r13793
2014-02-12 00:14:30 +00:00
Michael Gottesman
f70a1d8d1b [sil-aa] InitExistentialInst is a transitive escape inst.
Swift SVN r13792
2014-02-12 00:14:30 +00:00
Michael Gottesman
9453993493 [sil-aa] Create convenience methods isMustAlias, isNoAlias, isMayAlias and update AA uses to use these instead.
Swift SVN r13788
2014-02-11 22:56:56 +00:00
Michael Gottesman
4a37141f08 [sil-aa] Added in a quick fixme to notate for posterity that when in the way
future variadic address projections land, getUnderlyinObject and
findAddressProjectionPath should never disagree due to the former handling casts
in contrast with the later.

Swift SVN r13769
2014-02-11 01:03:43 +00:00
Michael Gottesman
de48699d49 [sil-aa] Teach SILAA how to prove that two GEPs from the same base pointer with the same projections must alias.
Swift SVN r13768
2014-02-11 00:55:09 +00:00
Michael Gottesman
10e529782c [sil-aa] Add support for distinguishing non escaping local objects and escape sources.
Swift SVN r13729
2014-02-10 01:48:14 +00:00
Michael Gottesman
bc8b8a521d Ensure that all uses of DisableAliasAnalysis are also conditionally compiled out when not compiling with Debug.
Swift SVN r13669
2014-02-08 00:56:56 +00:00
Michael Gottesman
d75da69b2f [sil-aa] Compile out DisableAliasAnalysis flag when not building Debug. Put in a comment making it clear that it should be removed once AA bringup is complete.
Swift SVN r13664
2014-02-08 00:07:13 +00:00
Michael Gottesman
2576075210 [sil-aa] Change disable-aa to be a hidden argument.
Swift SVN r13661
2014-02-07 23:00:52 +00:00
Michael Gottesman
d8f9e188b0 [sil-aa] Add command line option to turn off alias analysis. This is useful for measuring the effect of AA.
Swift SVN r13660
2014-02-07 22:57:00 +00:00
Michael Gottesman
94fb218a5e [sil-aa] Two SILValues that are the same without any stripping trivially alias each other.
Swift SVN r13609
2014-02-07 00:21:40 +00:00
Michael Gottesman
69d738e24c [sil-aa] A SILArgument is only a no-alias SILArgument if it is an argument to the first BB of a function.
Swift SVN r13608
2014-02-07 00:17:42 +00:00
Michael Gottesman
9a297333f9 Enable printing of AliasAnalysis::AliasResult and SILValues.
Swift SVN r13577
2014-02-06 10:06:20 +00:00
Michael Gottesman
abc9a8d7b6 [sil-aa] Teach SILAA that a SILArgument and something that is identifiable as a local object can not alias.
Swift SVN r13557
2014-02-06 04:31:06 +00:00
Michael Gottesman
d37ba66864 [sil-aa] Change isAllocationInst => isa<AllocationInst>. Remove isAllocationInst since it is dead code.
Swift SVN r13556
2014-02-06 04:31:06 +00:00
Michael Gottesman
098fda670f [sil-aa] Change SIL AliasAnalysis into an Analysis.
Swift SVN r13550
2014-02-06 02:29:41 +00:00
Michael Gottesman
7461dbd70a Now that we have a PM, separate passes from analyses by creating a separate library swiftSILAnalysis and a separate folder/etc.
Swift SVN r13511
2014-02-05 22:17:50 +00:00