enhance the optimizer to delete release(allocate()) pairs.  This is enough to zap 2 of them from the stdlib: ine from Format.printString.String, and one from Char.printFormatted.
enhance the optimizer to delete release(allocate()) pairs.  This is enough to zap 2 of
them from the stdlib: ine from Format.printString.String, and one from Char.printFormatted.

This is also enough to resolve rdar://11542743, allowing us to optimize:

func maxtest(x : Int) -> Int {
  return max(x, 0)
}

into:

define i64 @_T1t7maxtestFT1xNSs5Int64_S0_(i64 %x) nounwind {
entry:
  %0 = icmp sgt i64 %x, 0
  %x.y.i = select i1 %0, i64 %x, i64 0
  ret i64 %x.y.i
}

Instead of the mess of retains and releases shown in 11542743.



Swift SVN r2037

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