The new simplified design was inspired by a discussion with Michael. Thanks!
This implementation is much simpler and smaller than the old one. The tests are extended to check for more complex cases.
Swift SVN r23909
This patch improves handling of generic parameters and implements proper handling of metatypes, which were blocking correct devirtualization of inherited and specialized conformances. It enables a corresponding test, because all its blocking issues are resolved now.
Fixes rdar://17823742, rdar://17823746 and rdar://16847192
Swift SVN r23882
without a valid SILDebugScope. An assertion in IRGenSIL prevents future
optimizations from regressing in this regard.
Introducing SILBuilderWithScope and SILBuilderwithPostprocess to ease the
transition.
This patch is large, but mostly mechanical.
<rdar://problem/18494573> Swift: Debugger is not stopping at the set breakpoint
Swift SVN r22978
conformance.
Revert r19137 and keep the testing case. Commit a fix that combines
substitutions from the specialized protocol conformance and substitutions from
the ApplyInst; then uses the full substitution list in substGenericArgs.
I had a small SIL testing case that runs "sil-opt -devirtualize", but due to
rdar://18120894, the testing case failed to work.
rdar://17440222
Performance -----
Before:
Totals,54,114129,114129,114129,0,0 (O)
Totals,54,81957,81957,81957,0,0 (Ounchecked)
Totals,54,83157,83157,83157,0,0 (run 2 of Ounchecked)
After:
Totals,54,109847,109847,109847,0,0 (O)
Totals,54,80301,80301,80301,0,0 (Ounchecked)
Swift SVN r21442
that seaches for point-of-construction for classes outside of the function that
does the devirtualization. Now we have a utility that devirtualizes a class
given a ClassDecl. NFC.
Swift SVN r20946
Before this commit we scanned the vtables every time we wanted to know who are the subclasses of a class. Now we scan the vtables just once.
Swift SVN r20847
Devirtualization of inherited protocol conformances are not essential
for stdlib performance since in most cases the stdlib does not use class
types (in contrast to devirtualization of specialized protocol
conformances which /is/ essential). So for Seed 5 I am disabling this
for the reasons below:
We are not upcasting metatypes correctly and while debugging that I ran
into a case where in the protocol witness we had generic types as if
the protocol witness was potentially covariant in all arguments. This
caused the devirtualizer to subtitute in the witness type as
appropriate, but due to the covariant argument the devirtualizer did not
perform an upcast causing a verifier fail.
<rdar://problem/17823711>
Swift SVN r20612
Expose Substitution's archetype, replacement, and conformances only through getters so we can actually assert invariants about them. To start, require replacement types to be materializable in order to catch cases where the type-checker tries to bind type variables to lvalue or inout types, and require the conformance array to match the number of protocol conformances required by the archetype. This exposes some latent bugs in the test suite I've marked as failures for now:
- test/Constraints/overload.swift was quietly suffering from <rdar://problem/17507421>, but we didn't notice because we never tried to codegen it.
- test/SIL/Parser/array_roundtrip.swift doesn't correctly roundtrip substitutions, which I filed as <rdar://problem/17781140>.
Swift SVN r20418
In a few places we were calling into a function that just returned
T->hasArchetype(). This just changes those places to test it directly.
Swift SVN r19427