The old devirtualization procedure did not take into account the substitution list in the apply inst.
The new optimization works on the apply instruction that uses the archetype_method instruction.
We do not handle polymorphic types because we don't modify the protocol conformance yet.
Swift SVN r12826
For example, if ABC is not a generic type we can replace this instruction
with a function_ref instruction to a specific function:
archetype_method $ABC, #pingable.ping!1
Swift SVN r12571
In many cases these calls are constructors that were too big to be inlined.
We now devirtualize this code:
class ABC {
init() { /* Don't inline */ }
func member() { }
}
func foo() {
var x = ABC()
x.member()
}
Swift SVN r12223