File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -203,11 +203,11 @@ bool OSSACanonicalizeOwned::computeCanonicalLiveness() {
203203 // escape. Is it legal to canonicalize ForwardingUnowned?
204204 case OperandOwnership::ForwardingUnowned:
205205 case OperandOwnership::PointerEscape:
206+ case OperandOwnership::BitwiseEscape:
206207 LLVM_DEBUG (llvm::dbgs () << " Value escaped! Giving up\n " );
207208 return false ;
208209 case OperandOwnership::InstantaneousUse:
209210 case OperandOwnership::UnownedInstantaneousUse:
210- case OperandOwnership::BitwiseEscape:
211211 liveness->updateForUse (user, /* lifetimeEnding*/ false );
212212 break ;
213213 case OperandOwnership::ForwardingConsume:
Original file line number Diff line number Diff line change 1+ // RUN: %target-sil-opt -copy-propagation -enable-lexical-lifetimes=false %s | %FileCheck %s
2+
3+ sil_stage canonical
4+
5+ import Builtin
6+ import Swift
7+ import SwiftShims
8+
9+ class C {}
10+
11+ // CHECK-LABEL: sil [ossa] @bitwise_escape :
12+ // CHECK-NOT: destroy_value
13+ // CHECK: strong_copy_unmanaged_value
14+ // CHECK: destroy_value
15+ // CHECK-LABEL: } // end sil function 'bitwise_escape'
16+ sil [ossa] @bitwise_escape : $@convention(thin) (@owned Builtin.BridgeObject) -> @owned C {
17+ bb0(%0 : @owned $Builtin.BridgeObject):
18+ %1 = unchecked_trivial_bit_cast %0 to $UInt64
19+ %2 = struct_extract %1, #UInt64._value
20+ %3 = builtin "truncOrBitCast_Int64_Word"(%2) : $Builtin.Word
21+ %4 = builtin "inttoptr_Word"(%3) : $Builtin.RawPointer
22+ %5 = struct $UnsafeRawPointer (%4)
23+ %6 = unchecked_trivial_bit_cast %5 to $Unmanaged<C>
24+ %7 = struct_extract %6, #Unmanaged._value
25+ %8 = strong_copy_unmanaged_value %7
26+ destroy_value %0
27+ return %8
28+ }
29+
30+
You can’t perform that action at this time.
0 commit comments