Commits

Roman Levenstein committed e15b22cb8f2
[sil-combine] Fold checked_cast_addr_br when casting into protocol types if informations about conformances is available at compile-time. If we know at compile-time that a type being casted is conforming to a protocol, then we can replace the checked_cast_addr_br by an unconditional_checked_cast_addr followed by a branch to the success BB of the original checked_cast_addr_br instruction. If we cannot find at compile-time that a type being casted is conforming to the protocol, but we see that this type is not public, then we know that no new protocol conformance can be added by a different module at run-time. Therefore it is safe to assume that this type does not conform to the protocol and we can replace checked_cast_addr_br by a branch to the failure BB of the original checked_cast_addr_br instruction. rdar://19487336 Swift SVN r24493