[devirt] Disable devirt of inherited protocol conformances for Seed 5.

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
This commit is contained in:
Michael Gottesman
2014-07-28 03:42:51 +00:00
parent 1893e316bd
commit 02cb9bed86
2 changed files with 6 additions and 0 deletions

View File

@@ -339,9 +339,14 @@ bool WitnessMethodDevirtualizer::devirtualize() {
/// If we dont and do not have any substitutions, we must then have a pure
/// inherited protocol conformance.
if (Subs.empty()) {
#if 1
// Disable inherited protocol conformance for seed 5.
return false;
#else
assert(isa<InheritedProtocolConformance>(C) &&
"At this point C must be an inherited protocol conformance.");
return processInheritedProtocolConformance();
#endif
}
/// If we have substitutions, we must have some sort of specialized protocol