implement support for full conditional init/assign processing of tuple elements,  generating the appropriate shifting and or'ing of bits in our liveness mask to treat each tuple element separately.  This allows us to compile something like:
implement support for full conditional init/assign processing of tuple elements, 
generating the appropriate shifting and or'ing of bits in our liveness mask to
treat each tuple element separately.  This allows us to compile something like:

func test(cond : Bool) {
  var x : (SomeClass, SomeClass)

  if cond {
    x.0 = getSomeClass()
  } else {
    x.1 = getSomeClass() 
  }

  x.0 = getSomeClass()
  x.1 = x.0
}

into:

sil @_T1t4testFT4condSb_T_ : $@thin (Bool) -> () {
bb0(%0 : $Bool):
  %1 = builtin_function_ref "or_Int2" : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // users: %40, %24, %15, %57
  %2 = alloc_stack $Builtin.Int2  // var x        // users: %41, %39, %25, %23, %16, %14, %58, %56, %45, %31, %7, %64
  %3 = alloc_stack $Bool  // var cond             // users: %62, %4
  store %0 to %3#1 : $*Bool                       // id: %4
  %5 = alloc_stack $(SomeClass, SomeClass)  // var x // users: %52, %35, %61, %60, %12, %21, %30, %43, %44
  %6 = integer_literal $Builtin.Int2, 0           // user: %7
  store %6 to %2#1 : $*Builtin.Int2               // id: %7
  %8 = struct_extract %0 : $Bool, #value          // user: %9
  cond_br %8, bb1, bb2                            // id: %9

bb1:                                              // Preds: bb0
  // function_ref t.getSomeClass () -> t.SomeClass
  %10 = function_ref @_T1t12getSomeClassFT_CS_9SomeClass : $@thin () -> @owned SomeClass // user: %11
  %11 = apply %10() : $@thin () -> @owned SomeClass // user: %17
  %12 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 0 // user: %17
  %13 = integer_literal $Builtin.Int2, 1          // user: %15
  %14 = load %2#1 : $*Builtin.Int2                // user: %15
  %15 = apply %1(%14, %13) : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // user: %16
  store %15 to %2#1 : $*Builtin.Int2              // id: %16
  store %11 to %12 : $*SomeClass                  // id: %17
  br bb3                                          // id: %18

bb2:                                              // Preds: bb0
  // function_ref t.getSomeClass () -> t.SomeClass
  %19 = function_ref @_T1t12getSomeClassFT_CS_9SomeClass : $@thin () -> @owned SomeClass // user: %20
  %20 = apply %19() : $@thin () -> @owned SomeClass // user: %26
  %21 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 1 // user: %26
  %22 = integer_literal $Builtin.Int2, -2         // user: %24
  %23 = load %2#1 : $*Builtin.Int2                // user: %24
  %24 = apply %1(%23, %22) : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // user: %25
  store %24 to %2#1 : $*Builtin.Int2              // id: %25
  store %20 to %21 : $*SomeClass                  // id: %26
  br bb3                                          // id: %27

bb3:                                              // Preds: bb2 bb1
  // function_ref t.getSomeClass () -> t.SomeClass
  %28 = function_ref @_T1t12getSomeClassFT_CS_9SomeClass : $@thin () -> @owned SomeClass // user: %29
  %29 = apply %28() : $@thin () -> @owned SomeClass // user: %42
  %30 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 0 // user: %42
  %31 = load %2#1 : $*Builtin.Int2                // user: %33
  %32 = builtin_function_ref "trunc_Int2_Int1" : $@thin @callee_owned (Builtin.Int2) -> Builtin.Int1 // user: %33
  %33 = apply %32(%31) : $@thin @callee_owned (Builtin.Int2) -> Builtin.Int1 // user: %34
  cond_br %33, bb4, bb5                           // id: %34

bb4:                                              // Preds: bb3
  %35 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 0 // user: %36
  destroy_addr %35 : $*SomeClass                  // id: %36
  br bb5                                          // id: %37

bb5:                                              // Preds: bb3 bb4
  %38 = integer_literal $Builtin.Int2, 1          // user: %40
  %39 = load %2#1 : $*Builtin.Int2                // user: %40
  %40 = apply %1(%39, %38) : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // user: %41
  store %40 to %2#1 : $*Builtin.Int2              // id: %41
  store %29 to %30 : $*SomeClass                  // id: %42
  %43 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 0 // user: %59
  %44 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 1 // user: %59
  %45 = load %2#1 : $*Builtin.Int2                // user: %48
  %46 = builtin_function_ref "lshr_Int2" : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // user: %48
  %47 = integer_literal $Builtin.Int2, 1          // user: %48
  %48 = apply %46(%45, %47) : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // user: %50
  %49 = builtin_function_ref "trunc_Int2_Int1" : $@thin @callee_owned (Builtin.Int2) -> Builtin.Int1 // user: %50
  %50 = apply %49(%48) : $@thin @callee_owned (Builtin.Int2) -> Builtin.Int1 // user: %51
  cond_br %50, bb6, bb7                           // id: %51

bb6:                                              // Preds: bb5
  %52 = tuple_element_addr %5#1 : $*(SomeClass, SomeClass), 1 // user: %53
  destroy_addr %52 : $*SomeClass                  // id: %53
  br bb7                                          // id: %54

bb7:                                              // Preds: bb5 bb6
  %55 = integer_literal $Builtin.Int2, -2         // user: %57
  %56 = load %2#1 : $*Builtin.Int2                // user: %57
  %57 = apply %1(%56, %55) : $@thin @callee_owned (Builtin.Int2, Builtin.Int2) -> Builtin.Int2 // user: %58
  store %57 to %2#1 : $*Builtin.Int2              // id: %58
  copy_addr %43 to [initialization] %44 : $*SomeClass // id: %59
  destroy_addr %5#1 : $*(SomeClass, SomeClass)    // id: %60
  dealloc_stack %5#0 : $*@local_storage (SomeClass, SomeClass) // id: %61
  dealloc_stack %3#0 : $*@local_storage Bool      // id: %62
  %63 = tuple ()                                  // user: %65
  dealloc_stack %2#0 : $*@local_storage Builtin.Int2 // id: %64
  return %63 : $()                                // id: %65
}

Which ends up producing this LLVM IR at -O3:

define void @_T1t4testFT4condSb_T_(i1) #0 {
entry:
  %1 = tail call noalias %swift.refcounted* @swift_allocObject(...
  %2 = tail call noalias %swift.refcounted* @swift_allocObject(...
  tail call void @swift_release(%swift.refcounted* %2) #0
  tail call void @swift_release(%swift.refcounted* %1) #0
  ret void
}



Swift SVN r10700

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