When binding address-only let declarations to let arguments, use the  buffer being passed in, instead of creating a temporary one and copying into it.
When binding address-only let declarations to let arguments, use the 
buffer being passed in, instead of creating a temporary one and copying
into it.

For:

func generic_identity<T>(let a : T) -> T {
  return a
}

We now get:

sil @_TF2t216generic_identityU__FT1aQ__Q_ : $@thin <$T_0_0> (@out $T_0_0, @in $T_0_0) -> () {
bb0(%0 : $*T, %1 : $*T):
  copy_addr [take] %1 to [initialization] %0 : $*T // id: %2
  %3 = tuple ()                                   // user: %4
  return %3 : $()                                 // id: %4
}

We used to produce:

sil @_TF2t216generic_identityU__FT1aQ__Q_ : $@thin <$T_0_0> (@out $T_0_0, @in $T_0_0) -> () {
bb0(%0 : $*T, %1 : $*T):
  %2 = alloc_box $T  // let a                     // users: %5, %4, %3
  copy_addr [take] %1 to [initialization] %2#1 : $*T // id: %3
  copy_addr %2#1 to [initialization] %0 : $*T     // id: %4
  strong_release %2#0 : $Builtin.ObjectPointer    // id: %5
  %6 = tuple ()                                   // user: %7
  return %6 : $()                                 // id: %7
}

and then optimize it into:

sil @_TF2t216generic_identityU__FT1aQ__Q_ : $@thin <$T_0_0> (@out $T_0_0, @in $T_0_0) -> () {
bb0(%0 : $*T, %1 : $*T):
  %2 = alloc_stack $T  // let a                   // users: %5, %3, %4
  copy_addr [take] %1 to [initialization] %2#1 : $*T // id: %3
  copy_addr [take] %2#1 to [initialization] %0 : $*T // id: %4
  dealloc_stack %2#0 : $*@local_storage T         // id: %5
  %6 = tuple ()                                   // user: %7
  return %6 : $()                                 // id: %7
}



Swift SVN r11941

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