@@ -686,20 +686,6 @@ SILInstruction *SILCombiner::visitCondFailInst(CondFailInst *CFI) {
686
686
return nullptr ;
687
687
}
688
688
689
- static bool isValueToBridgeObjectremovable (ValueToBridgeObjectInst *VTBOI) {
690
- SILValue operand = VTBOI->getOperand ();
691
- // If operand is a struct $UInt (% : $Builtin.), fetch the real source
692
- if (auto *SI = dyn_cast<StructInst>(operand)) {
693
- assert (SI->SILInstruction ::getAllOperands ().size () == 1 &&
694
- " Expected a single operand" );
695
- operand = SI->getOperand (0 );
696
- }
697
- if (auto *BI = dyn_cast<BuiltinInst>(operand)) {
698
- return (BI->getBuiltinInfo ().ID == BuiltinValueKind::StringObjectOr);
699
- }
700
- return false ;
701
- }
702
-
703
689
SILInstruction *SILCombiner::visitStrongRetainInst (StrongRetainInst *SRI) {
704
690
// Retain of ThinToThickFunction is a no-op.
705
691
SILValue funcOper = SRI->getOperand ();
@@ -718,8 +704,7 @@ SILInstruction *SILCombiner::visitStrongRetainInst(StrongRetainInst *SRI) {
718
704
// builtin "stringObjectOr_Int64" (or to tag the string)
719
705
// value_to_bridge_object (cast the UInt to bridge object)
720
706
if (auto *VTBOI = dyn_cast<ValueToBridgeObjectInst>(SRI->getOperand ())) {
721
- if (isValueToBridgeObjectremovable (VTBOI))
722
- return eraseInstFromFunction (*SRI);
707
+ return eraseInstFromFunction (*SRI);
723
708
}
724
709
725
710
// Sometimes in the stdlib due to hand offs, we will see code like:
@@ -1169,8 +1154,7 @@ SILInstruction *SILCombiner::visitStrongReleaseInst(StrongReleaseInst *SRI) {
1169
1154
// builtin "stringObjectOr_Int64" (or to tag the string)
1170
1155
// value_to_bridge_object (cast the UInt to bridge object)
1171
1156
if (auto *VTBOI = dyn_cast<ValueToBridgeObjectInst>(SRI->getOperand ())) {
1172
- if (isValueToBridgeObjectremovable (VTBOI))
1173
- return eraseInstFromFunction (*SRI);
1157
+ return eraseInstFromFunction (*SRI);
1174
1158
}
1175
1159
1176
1160
// Release of a classbound existential converted from a class is just a
0 commit comments