Commit Graph

14 Commits

Author SHA1 Message Date
Slava Pestov
4ed09b4a73 SILOptimizer: Remove some workarounds for old problems
It looks like the devirtualizer used to have problems computing
method types in the presence of generic substitutions, covariant
returns and other things, so it would bail if a perticular set
of pre-conditions was not met on the types of original method call
and the devirtualized method call.

I don't think any of this is necessary anymore. If this patch
introduces any regressions, we need to fix the root cause instead
of re-introducing this logic.
2017-02-27 00:03:46 -08:00
Erik Eckstein
a67a4e1a38 Don't de-virtualize in SILCombine.
It is important to de-serialize the devirtualized function (and its callees), especially because we must make sure that all transparent functions are de-serialized.
SILCombine did not do that. But as we have the same optimization in the Devirtualizer, it's not needed to duplicate the code in SILCombine.

The only reason we had this peephole in SILCombine is that the Devirtualizer pass could not handle partial applies.
So with this change the Devirtualizer can now also handle partial applies.

Fixes rdar://problem/30544344 (again, after my first attempt failed)
2017-02-20 09:36:26 -08:00
Roman Levenstein
ab1fd78ffe [sil-devirtualizer] Introduce a helper method canDevirtualizeApply
This predicate can be used to check if a given call can be devirtualized. One of the clients of this new API will be the inliner, which may want to check if a given method call becomes devirtualizable after inlining.
2017-02-16 12:11:19 -08:00
Jordan Rose
1c60910198 Revert "Merge pull request #6092 from swiftix/wip-generics-inlining-flag-4"
This reverts commit 1b3d29a163, reversing
changes made to b32424953e.

We're seeing a handful of issues from turning on inlining of generics,
so I'm reverting to unblock the bots.
2017-02-13 10:52:17 -08:00
Roman Levenstein
40b7851198 [sil-devirtualizer] Re-factoring making it possible to check if an apply can be devirtualized. NFC.
It is now possible to check for any apply if it can be devirtualized without actually performing the deirtualization. This could be used e.g. by inlining heuristics.
2017-02-10 07:41:54 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Roman Levenstein
a4d7b37eec [sil-devirtualizer] Use stricter type checks before casting
Before generating an upcast instruction, make sure that the required type conversion is valid.

Fixes rdar://28601761
2016-10-17 10:42:09 -07:00
Roman Levenstein
73b6a38edc [sil-devirtualizer] Do not perform a speculative devirtualization for no-opt callees. 2016-05-11 16:28:50 -07:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Roman Levenstein
e05a72a1cb [sil-devirtualizer] Add a ClassHierarchyAnalysis parameter to tryDevirtualizeApply.
Not functionality changes yet. Subsequent patches will make use of this parameter.
2015-12-14 10:11:47 -08:00
Roman Levenstein
cbcd008ac4 [sil-devirtualizer] Rename isClassWithUnboundGenericParameters and extend it to work with any nominal types 2015-12-14 10:11:46 -08:00
Andrew Trick
84450b4c43 Reorganize SILOptimizer directories for better discoverability.
(Headers first)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 12:34:51 -08:00