Commits

Michael Gottesman committed 9b68a2e2051
[sil-code-motion] Combine together SILCodeMotion and Enum Simplification. The reason why this is being done is that this eliminates phase ordering issues between these two sinking passes. Specifically, a retain should be able to move through multiple iterated switch regions if there are no intervening instructions that may decrement its ref count. With the passes separate, sil code motion would move the retain into the switch region until the end of the switch region. Then it could not move it out of the switch region. Then enum simplification would move it out of the switch region but would move it no further. Thus the retain would need to wait for the ARC Optimizer or SILCodeMotion to move the retain to the next switch. Then enum simplification could process it again. Thus given the number of times that we iterate, given enough switches the optimizer would be unable to push the retains. Now that this has been done, after we move the retain out of the switch region, we can keep sinking it to the next switch region, move the retain into there, etc. That work will be done in a later radar. Given where we are in the schedule I am not going to remove the old enum simplification pass or combine together the two passes more than crudely so that (hopefully) cherry-picking will be easier if necessary. I will perform more indepth combination later. <rdar://problem/18033238> Swift SVN r21502