Implement two simple passes in the ARC optimizer: 1. First thing, canonicalize the input IR so that nothing uses the result of     swift_retain, making it easier to reason about pointers.
Implement two simple passes in the ARC optimizer:
1. First thing, canonicalize the input IR so that nothing uses the result of 
   swift_retain, making it easier to reason about pointers.

<nothing in between yet>

2. Last thing, optimize register pressure by making use of the return value 
   of swift_retain where possible.

#1 is a pessimization, but is fixed (optimally!) by #2.  Our implementation
of #2 is more powerful than the ObjC ARC optimizers corresponding stuff, because
we insert PHI nodes etc in cases where there isn't a strictly dominating retain
of a use.  Ours is also much simpler :)



Swift SVN r2030

mightydeveloper/swift,xwu/swift,brentdax/swift,ahoppen/swift,SwiftAndroid/swift,lorentey/swift,natecook1000/swift,glessard/swift,MukeshKumarS/Swift,KrishMunot/swift,stephentyrone/swift,OscarSwanros/swift,bitjammer/swift,uasys/swift,devincoughlin/swift,cbrentharris/swift,kstaring/swift,swiftix/swift.old,sschiau/swift,therealbnut/swift,KrishMunot/swift,frootloops/swift,hooman/swift,tkremenek/swift,ben-ng/swift,return/swift,JGiola/swift,khizkhiz/swift,bitjammer/swift,calebd/swift,parkera/swift,ken0nek/swift,jckarter/swift,natecook1000/swift,CodaFi/swift,ken0nek/swift,SwiftAndroid/swift,khizkhiz/swift,jopamer/swift,CodaFi/swift,Jnosh/swift,OscarSwanros/swift,xedin/swift,airspeedswift/swift,milseman/swift,lorentey/swift,gregomni/swift,cbrentharris/swift,jckarter/swift,bitjammer/swift,JaSpa/swift,KrishMunot/swift,CodaFi/swift,return/swift,CodaFi/swift,benlangmuir/swift,jmgc/swift,felix91gr/swift,deyton/swift,djwbrown/swift,kusl/swift,sdulal/swift,cbrentharris/swift,harlanhaskins/swift,xedin/swift,johnno1962d/swift,manavgabhawala/swift,swiftix/swift.old,parkera/swift,slavapestov/swift,LeoShimonaka/swift,xwu/swift,ben-ng/swift,sdulal/swift,LeoShimonaka/swift,karwa/swift,sdulal/swift,jopamer/swift,harlanhaskins/swift,adrfer/swift,russbishop/swift,arvedviehweger/swift,kusl/swift,kstaring/swift,cbrentharris/swift,kperryua/swift,SwiftAndroid/swift,lorentey/swift,shajrawi/swift,parkera/swift,LeoShimonaka/swift,rudkx/swift,calebd/swift,jckarter/swift,huonw/swift,IngmarStein/swift,karwa/swift,CodaFi/swift,manavgabhawala/swift,frootloops/swift,practicalswift/swift,jtbandes/swift,ahoppen/swift,benlangmuir/swift,parkera/swift,ben-ng/swift,alblue/swift,jckarter/swift,calebd/swift,jopamer/swift,apple/swift,return/swift,natecook1000/swift,xwu/swift,khizkhiz/swift,kusl/swift,danielmartin/swift,practicalswift/swift,therealbnut/swift,xwu/swift,shahmishal/swift,milseman/swift,khizkhiz/swift,harlanhaskins/swift,amraboelela/swift,roambotics/swift,xwu/swift,austinzheng/swift,gmilos/swift,emilstahl/swift,amraboelela/swift,mightydeveloper/swift,airspeedswift/swift,sdulal/swift,shahmishal/swift,uasys/swift,shahmishal/swift,modocache/swift,apple/swift,IngmarStein/swift,Jnosh/swift,johnno1962d/swift,arvedviehweger/swift,jckarter/swift,jtbandes/swift,aschwaighofer/swift,gmilos/swift,bitjammer/swift,frootloops/swift,adrfer/swift,natecook1000/swift,tinysun212/swift-windows,modocache/swift,therealbnut/swift,calebd/swift,zisko/swift,manavgabhawala/swift,danielmartin/swift,huonw/swift,sschiau/swift,swiftix/swift,Jnosh/swift,johnno1962d/swift,allevato/swift,brentdax/swift,gmilos/swift,practicalswift/swift,tardieu/swift,jmgc/swift,slavapestov/swift,russbishop/swift,swiftix/swift,shahmishal/swift,manavgabhawala/swift,tinysun212/swift-windows,adrfer/swift,tjw/swift,kperryua/swift,devincoughlin/swift,parkera/swift,danielmartin/swift,manavgabhawala/swift,mightydeveloper/swift,kentya6/swift,dduan/swift,allevato/swift,uasys/swift,gmilos/swift,huonw/swift,emilstahl/swift,nathawes/swift,ken0nek/swift,tinysun212/swift-windows,airspeedswift/swift,brentdax/swift,dduan/swift,hooman/swift,milseman/swift,arvedviehweger/swift,swiftix/swift.old,swiftix/swift,uasys/swift,airspeedswift/swift,allevato/swift,tardieu/swift,glessard/swift,kusl/swift,practicalswift/swift,apple/swift,milseman/swift,return/swift,adrfer/swift,gribozavr/swift,alblue/swift,amraboelela/swift,rudkx/swift,aschwaighofer/swift,jtbandes/swift,dduan/swift,cbrentharris/swift,OscarSwanros/swift,tinysun212/swift-windows,deyton/swift,hughbe/swift,atrick/swift,gribozavr/swift,OscarSwanros/swift,adrfer/swift,atrick/swift,amraboelela/swift,xedin/swift,felix91gr/swift,kentya6/swift,tkremenek/swift,amraboelela/swift,frootloops/swift,natecook1000/swift,tjw/swift,russbishop/swift,IngmarStein/swift,atrick/swift,swiftix/swift,atrick/swift,devincoughlin/swift,ken0nek/swift,djwbrown/swift,karwa/swift,parkera/swift,zisko/swift,practicalswift/swift,slavapestov/swift,therealbnut/swift,benlangmuir/swift,ben-ng/swift,tjw/swift,lorentey/swift,shahmishal/swift,aschwaighofer/swift,ken0nek/swift,Ivacker/swift,zisko/swift,gmilos/swift,gribozavr/swift,gottesmm/swift,Jnosh/swift,SwiftAndroid/swift,felix91gr/swift,nathawes/swift,cbrentharris/swift,frootloops/swift,emilstahl/swift,modocache/swift,devincoughlin/swift,MukeshKumarS/Swift,hooman/swift,shahmishal/swift,OscarSwanros/swift,Jnosh/swift,johnno1962d/swift,johnno1962d/swift,glessard/swift,karwa/swift,sdulal/swift,kperryua/swift,kstaring/swift,nathawes/swift,KrishMunot/swift,JaSpa/swift,uasys/swift,LeoShimonaka/swift,arvedviehweger/swift,IngmarStein/swift,ben-ng/swift,natecook1000/swift,practicalswift/swift,stephentyrone/swift,codestergit/swift,Ivacker/swift,parkera/swift,lorentey/swift,atrick/swift,modocache/swift,calebd/swift,sdulal/swift,JaSpa/swift,allevato/swift,practicalswift/swift,therealbnut/swift,dreamsxin/swift,emilstahl/swift,gmilos/swift,sschiau/swift,swiftix/swift.old,IngmarStein/swift,JaSpa/swift,LeoShimonaka/swift,kusl/swift,felix91gr/swift,devincoughlin/swift,atrick/swift,milseman/swift,frootloops/swift,emilstahl/swift,Ivacker/swift,slavapestov/swift,roambotics/swift,Ivacker/swift,gottesmm/swift,kperryua/swift,mightydeveloper/swift,hughbe/swift,swiftix/swift,gribozavr/swift,ben-ng/swift,gribozavr/swift,arvedviehweger/swift,dduan/swift,huonw/swift,xedin/swift,gottesmm/swift,tkremenek/swift,felix91gr/swift,bitjammer/swift,sschiau/swift,djwbrown/swift,calebd/swift,jtbandes/swift,gregomni/swift,SwiftAndroid/swift,return/swift,cbrentharris/swift,jmgc/swift,austinzheng/swift,gottesmm/swift,adrfer/swift,LeoShimonaka/swift,calebd/swift,hughbe/swift,glessard/swift,milseman/swift,kperryua/swift,rudkx/swift,aschwaighofer/swift,lorentey/swift,emilstahl/swift,MukeshKumarS/Swift,kentya6/swift,karwa/swift,mightydeveloper/swift,swiftix/swift.old,nathawes/swift,sschiau/swift,karwa/swift,tardieu/swift,allevato/swift,kusl/swift,Ivacker/swift,austinzheng/swift,gmilos/swift,xwu/swift,CodaFi/swift,KrishMunot/swift,therealbnut/swift,modocache/swift,rudkx/swift,LeoShimonaka/swift,devincoughlin/swift,glessard/swift,zisko/swift,therealbnut/swift,russbishop/swift,gregomni/swift,tjw/swift,jckarter/swift,tardieu/swift,dreamsxin/swift,manavgabhawala/swift,hughbe/swift,sschiau/swift,glessard/swift,zisko/swift,MukeshKumarS/Swift,emilstahl/swift,roambotics/swift,tkremenek/swift,xedin/swift,JaSpa/swift,swiftix/swift,russbishop/swift,tinysun212/swift-windows,sschiau/swift,tjw/swift,alblue/swift,gribozavr/swift,johnno1962d/swift,IngmarStein/swift,jopamer/swift,jtbandes/swift,huonw/swift,kusl/swift,shajrawi/swift,gregomni/swift,huonw/swift,kstaring/swift,mightydeveloper/swift,jopamer/swift,sdulal/swift,swiftix/swift.old,devincoughlin/swift,sschiau/swift,shajrawi/swift,djwbrown/swift,lorentey/swift,nathawes/swift,JGiola/swift,Ivacker/swift,shajrawi/swift,kstaring/swift,slavapestov/swift,xedin/swift,frootloops/swift,OscarSwanros/swift,airspeedswift/swift,aschwaighofer/swift,dduan/swift,IngmarStein/swift,alblue/swift,danielmartin/swift,apple/swift,roambotics/swift,KrishMunot/swift,cbrentharris/swift,apple/swift,kentya6/swift,deyton/swift,huonw/swift,shajrawi/swift,MukeshKumarS/Swift,felix91gr/swift,russbishop/swift,kentya6/swift,shajrawi/swift,djwbrown/swift,gottesmm/swift,hooman/swift,gregomni/swift,alblue/swift,benlangmuir/swift,shajrawi/swift,benlangmuir/swift,deyton/swift,parkera/swift,JGiola/swift,khizkhiz/swift,jmgc/swift,natecook1000/swift,shahmishal/swift,jopamer/swift,lorentey/swift,kusl/swift,xwu/swift,allevato/swift,brentdax/swift,gottesmm/swift,manavgabhawala/swift,codestergit/swift,swiftix/swift.old,xedin/swift,austinzheng/swift,JGiola/swift,ben-ng/swift,OscarSwanros/swift,dduan/swift,codestergit/swift,MukeshKumarS/Swift,amraboelela/swift,nathawes/swift,shahmishal/swift,mightydeveloper/swift,JaSpa/swift,djwbrown/swift,sdulal/swift,rudkx/swift,hughbe/swift,hooman/swift,rudkx/swift,KrishMunot/swift,LeoShimonaka/swift,alblue/swift,arvedviehweger/swift,jopamer/swift,apple/swift,Ivacker/swift,codestergit/swift,dduan/swift,tinysun212/swift-windows,alblue/swift,gregomni/swift,Ivacker/swift,austinzheng/swift,emilstahl/swift,zisko/swift,CodaFi/swift,kentya6/swift,jtbandes/swift,hooman/swift,russbishop/swift,return/swift,djwbrown/swift,JGiola/swift,danielmartin/swift,MukeshKumarS/Swift,aschwaighofer/swift,gribozavr/swift,roambotics/swift,Jnosh/swift,stephentyrone/swift,SwiftAndroid/swift,kentya6/swift,JGiola/swift,benlangmuir/swift,ken0nek/swift,deyton/swift,kstaring/swift,swiftix/swift.old,swiftix/swift,return/swift,stephentyrone/swift,brentdax/swift,kentya6/swift,jtbandes/swift,allevato/swift,johnno1962d/swift,tardieu/swift,austinzheng/swift,tjw/swift,bitjammer/swift,shajrawi/swift,zisko/swift,hughbe/swift,xedin/swift,amraboelela/swift,gribozavr/swift,nathawes/swift,austinzheng/swift,devincoughlin/swift,SwiftAndroid/swift,karwa/swift,codestergit/swift,modocache/swift,airspeedswift/swift,hughbe/swift,harlanhaskins/swift,kperryua/swift,khizkhiz/swift,bitjammer/swift,milseman/swift,tkremenek/swift,hooman/swift,tjw/swift,roambotics/swift,danielmartin/swift,kstaring/swift,aschwaighofer/swift,practicalswift/swift,uasys/swift,felix91gr/swift,tardieu/swift,tardieu/swift,slavapestov/swift,kperryua/swift,ahoppen/swift,ahoppen/swift,danielmartin/swift,stephentyrone/swift,jmgc/swift,ahoppen/swift,jmgc/swift,stephentyrone/swift,deyton/swift,tinysun212/swift-windows,ahoppen/swift,stephentyrone/swift,ken0nek/swift,tkremenek/swift,codestergit/swift,deyton/swift,modocache/swift,jmgc/swift,brentdax/swift,slavapestov/swift,jckarter/swift,mightydeveloper/swift,adrfer/swift,arvedviehweger/swift,uasys/swift,Jnosh/swift,karwa/swift,harlanhaskins/swift,gottesmm/swift,brentdax/swift,khizkhiz/swift,tkremenek/swift,airspeedswift/swift,codestergit/swift,harlanhaskins/swift,harlanhaskins/swift,JaSpa/swift