Commits

Michael Gottesman committed 1f6238f0c5d
[rc-id] Check dominance before recursively stripping instead of vis-a-versa. Before this change, given a CFG like the following: bb0: %0 = enum $Optional<Cls>, #Optional.None!enumelt br bb1(%0 : $Optional<Cls>) bb1(%1 : $Optional<Cls>): %2 = alloc_ref $Cls retain_value %2 : $Cls release_value %1 : $Optional<Cls> %3 = enum $Optional<Cls>, #Optional.Some!enumelt.1, %2 : $Cls cond_br undef, bb1(%3 : $Optional<Cls>), bb2 bb2: ... We would pair up the retain, release even though they are from different iterations. The reason we were doing this is that we were recursively stripping off the Phi node before checking dominance instead of vis-a-versa. rdar://18367606 Swift SVN r22892