Commits

Michael Gottesman committed 45ca455c1c6
[devirtualization] Simplify/refactor optimizeClassMethod. The only case which we were handling in the old code where the class method was not dead was when we had an apply inst of the class method. This commit simplifies all of the weird code therein by causing class method optimization to go through the same optimization pathway as how we optimize protocol methods and witness methods (i.e. we pattern match on the apply and only replace the apply). This makes the code much simpler and more readable. Additionally while working on test cases I noticed that relying on SILCombine to peephole convert_function creates phase ordering issues since SILCombine does not cause additional optimizer iterations to run implying that we can have a situation where we devirtualize, fail to inline, then silcombine (which would allow us to optimize), but then the pass manager does not go around another time. Thus I move that operation into the devirtualizer itself since it is relatively simple to do. Also re-enable test/SILPasses/devirt_override.sil since we handle it correctly now. Swift SVN r17566