Commits

Chris Lattner committed 2063e9b2257
Enhance DCE to know that "condfail(false)" is dead. Enhance constant propagation (a diagnostic pass) to invoke the DCE utility when producing a condfail(false). This fixes rdar://15729207. Before we -emit-sil'd the testcase to: sil @_TF1t1fFT_Si : $@thin () -> Int64 { bb0: %0 = tuple () %1 = integer_literal $Builtin.Int1, 0 // user: %2 cond_fail %1 : $Builtin.Int1 // id: %2 %3 = integer_literal $Builtin.Int64, 8 // user: %5 %4 = integer_literal $Builtin.Int1, 0 // user: %6 %5 = struct $Int64 (%3 : $Builtin.Int64) // user: %7 cond_fail %4 : $Builtin.Int1 // id: %6 return %5 : $Int64 // id: %7 } and now we produce (if you ignore debug_value): sil @_TF1t1fFT_Si : $@thin () -> Int64 { bb0: %9 = integer_literal $Builtin.Int64, 8 // user: %10 %10 = struct $Int64 (%9 : $Builtin.Int64) // user: %11 return %10 : $Int64 // id: %11 } Swift SVN r12490