Commit Graph

26 Commits

Author SHA1 Message Date
Michael Gottesman
1f93ec5480 [devirtualization] Remove deep devirtualization code that we are not using for WWDC.
If we decide in the future to do this we can always revert this commit.

Swift SVN r17293
2014-05-03 00:33:46 +00:00
Manman Ren
c2f32d7e24 [Inliner] revert r17101 since it causes a performance regression on MD5.
See rdar://16676020 for details.
r17101 tries to solve r16761933 by checking non-direct recursions in
the call graph. We are in discussion of solving it in a different way.

Todo: figure out why r17101 causes a preformance regression.


Swift SVN r17265
2014-05-02 19:00:36 +00:00
Nadav Rotem
e406e43060 Disable the inlining of non-direct recursions (where A->B->A).
Swift SVN r17101
2014-04-30 18:45:13 +00:00
Michael Gottesman
8ffc0f10a3 [sil-aa] AA::may{Read,Write,ReadOrWrite}FromMemory do not care about ref counts. Add a flag to ignore ref counts during such a query.
This is due to MayHaveSideEffects encompassing ref count effects and a
myriad of other effects. If/when we separate the two concepts (which is
cleaner IMHO), the flag will no longer be necessary.

Swift SVN r16807
2014-04-25 06:37:02 +00:00
Michael Gottesman
b04b14e0fa Refactor isNonEscapingLocalObject/getUnderlying object into their own file ValueTracking.cpp.
This is because I need them in ARCAnalysis.cpp and from a modeling
perspective it is no longer just going to be used just in AA since they
are of larger functionality.

Swift SVN r16297
2014-04-14 04:44:53 +00:00
Nadav Rotem
1bfa103362 Add a basic TBAA rule.
Swift SVN r15358
2014-03-22 01:12:09 +00:00
Nadav Rotem
e620ed323c Additional negative logic changes. NFC.
Swift SVN r14743
2014-03-06 19:10:32 +00:00
Nadav Rotem
15ec637128 Reverse the negative logic. NFC.
Swift SVN r14742
2014-03-06 19:02:42 +00:00
Michael Gottesman
0044c1d379 [arc-opts] Teach cannotDecrementRefCount how to use alias information to prove
that an apply which may decrement ref counts can not decrement a value with
reference semantics if we can prove the value does not alias any of the applies
arguments.

Swift SVN r14120
2014-02-20 01:08:49 +00:00
Michael Gottesman
fbe2ccf0d6 [sil-aa] Add in convenience methods for querying AliasAnalysis::getMemoryBehavior.
The methods are:

 * mayWriteToMemory()
 * mayReadFromMemory()
 * mayReadOrWriteMemory()
 * mayHaveSideEffects() [Side effects + writing to memory]
 * mayHavePureSideEffects() [Only side effects, ignores writes to memory]

Swift SVN r13791
2014-02-12 00:14:29 +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
Andrew Trick
90bdf1f841 Run a sequence of SILFunctionTransforms on the same function.
It is much easier to follow the progreses of optimizations. And should
be more efficient.

Swift SVN r13678
2014-02-08 08:20:46 +00:00
Andrew Trick
4da216c7c7 Add a PassManager analysis that tracks changed/complete functions.
Don't print/verify unless something has changed.
Don't rerun function passes on functions that have not changed.

Swift SVN r13675
2014-02-08 08:20:44 +00:00
Michael Gottesman
8cb9693830 [sil-arc-opts] Teach SILARCOpts how to use alias analysis to determine if a store/load could use a value.
Swift SVN r13658
2014-02-07 22:56:59 +00:00
Andrew Trick
04b2b5256b First implementation of <rdar://15922760> Deep devirtualization -
specialize on polymorphic arguments.

This can be enabled with: -sil-devirt-threshold 500.

It currently improves RC4 (when enabled) by 20%, but will be much more
important after Michael's load elimination with alias analysis lands.

This implementation is suitable for experimentation. Superficial code
reviews are also welcome. Although be warned that the design is overly
complex and I plan to rewrite it. I initially abandoned the idea of
incrementally specializing one function at a time, thinking that we
need to analyze full chains. However, I since realized after talking
to Nadav that the incremental approach can be made to work. A lot of
book-keeping will go away with that change.

TODO:

- Resolve protocol argument types. Currently we assume they can be
  reinitialized at applies, but I don't think they can unless they are
  @inouts.  This is an issue with the existing local devirtualizer
  that prevents it working across calls.

- Properly mangle the specialized methods. Find existing
  specializations by demangling rather than maintaining a map.

- Rewrite the logic for specializing chains for simplicity.

- Enable by default.

Swift SVN r13642
2014-02-07 19:10:27 +00:00
Nadav Rotem
27a1a63134 Remove unneeded empty virtual destructors.
Swift SVN r13599
2014-02-06 22:24:33 +00:00
Michael Gottesman
9a297333f9 Enable printing of AliasAnalysis::AliasResult and SILValues.
Swift SVN r13577
2014-02-06 10:06:20 +00:00
Nadav Rotem
0651b9bbd0 Add a new Dominance Analysis that wraps DomInfo and PDomInfo, and migrate the
passes that use them.



Swift SVN r13571
2014-02-06 07:52:16 +00:00
Nadav Rotem
5155177333 Fix a spelling mistake.
Swift SVN r13560
2014-02-06 04:32:00 +00:00
Michael Gottesman
a4a0e09b1b Remove alias analysis invalidation.
Swift SVN r13558
2014-02-06 04:31:07 +00:00
Nadav Rotem
d6802340fe Change the CallGraph Analysis API and add cacheing and invalidation methods.
Swift SVN r13554
2014-02-06 04:24:51 +00:00
Michael Gottesman
098fda670f [sil-aa] Change SIL AliasAnalysis into an Analysis.
Swift SVN r13550
2014-02-06 02:29:41 +00:00
Nadav Rotem
93b5cac34e Remove the top-down call graph ABI and use the reverse bottom-up.
Swift SVN r13544
2014-02-06 01:52:14 +00:00
Michael Gottesman
03d16cfce2 Fix header guards to match reset of headers. NFC.
Swift SVN r13524
2014-02-05 23:41:33 +00:00
Michael Gottesman
20f2f45703 In light of the new swiftAnalysisLibrary, move lib/SILPasses/Analysis.cpp => lib/SILAnalysis/Analysis.cpp and perform the analogous change for Analysis.h.
Swift SVN r13523
2014-02-05 23:37:36 +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