Commit Graph

209 Commits

Author SHA1 Message Date
Nadav Rotem
baa1d1679a Teach some of the passes about the new PM.
Swift SVN r13494
2014-02-05 18:58:23 +00:00
Nadav Rotem
5310265dba Devirtualize archetype_method of polymorphic functions.
Patch by Joe.



Swift SVN r13007
2014-01-27 22:01:20 +00:00
Nadav Rotem
8fa61139ad Remove the old archetype_method devirtualization procedure and implement a new one.
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
2014-01-23 00:29:44 +00:00
Nadav Rotem
91eff3655d Refactor the duplicated code for finding a static function in the witness table. NFC.
Swift SVN r12601
2014-01-20 18:46:21 +00:00
Nadav Rotem
42c966fc14 Devirtualize archetype_method instructions on non-generic lookup types.
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
2014-01-20 06:22:16 +00:00
Nadav Rotem
3d1d558aac Add debug prints.
Swift SVN r12224
2014-01-13 09:39:35 +00:00
Nadav Rotem
0271c34d77 Devirtualize: teach the class_method devirtualization type-search procedure to look into apply instructions.
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
2014-01-13 09:32:54 +00:00
Nadav Rotem
32f47906bd Refactor findClassTypeForOperand. NFC.
Swift SVN r12222
2014-01-13 07:56:48 +00:00
Nadav Rotem
970c387c34 Refactor devirt related optimizations from sil-combine into a new pass.
The reason is that I would like to add more sophisticated analysis and a
chache, which does not fit into sil-combine very well.



Swift SVN r12221
2014-01-13 07:34:25 +00:00