File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
lib/SILOptimizer/Analysis Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,6 @@ bool swift::canUseObject(SILInstruction *Inst) {
175175 case SILInstructionKind::UncheckedAddrCastInst:
176176 case SILInstructionKind::RefToRawPointerInst:
177177 case SILInstructionKind::RawPointerToRefInst:
178- case SILInstructionKind::UnconditionalCheckedCastInst:
179178 case SILInstructionKind::UncheckedBitwiseCastInst:
180179 case SILInstructionKind::EndInitLetRefInst:
181180 case SILInstructionKind::BeginDeallocRefInst:
Original file line number Diff line number Diff line change @@ -1123,3 +1123,18 @@ bb1:
11231123 return %5 : $()
11241124}
11251125
1126+ // CHECK: sil @dont_hoist_release_accross_cast
1127+ // CHECK: retain
1128+ // CHECK: apply
1129+ // CHECK: unconditional_checked_cast
1130+ // CHECK: release
1131+ sil @dont_hoist_release_accross_cast : $@convention(thin) (B, B) -> () {
1132+ bb0(%0 : $B, %1: $B):
1133+ strong_retain %0: $B
1134+ apply undef() : $@convention(thin) () -> ()
1135+ %3 = unconditional_checked_cast %0 : $B to Builtin.NativeObject
1136+ strong_release %0: $B
1137+ %5 = tuple()
1138+ return %5 : $()
1139+ }
1140+
You can’t perform that action at this time.
0 commit comments