mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
"reborrow" flag on the SILArgument avoids transitive walk over the phi operandsi to determine if it is a reborrow in multiple utilities. SIL transforms must keep the flag up-to-date by calling SILArgument::setReborrow. SILVerifier checks to ensure the flag is not invalidated. Currently "escaping" is not used anywhere.
21 lines
697 B
Plaintext
21 lines
697 B
Plaintext
// RUN: %target-sil-opt %s | %target-sil-opt | %FileCheck %s
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
|
|
// CHECK-LABEL: sil [ossa] @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
|
|
// CHECK: bb1([[PHIBBARG:%.*]] : @reborrow @guaranteed $Builtin.NativeObject):
|
|
// CHECK: end_borrow [[PHIBBARG]] : $Builtin.NativeObject
|
|
sil [ossa] @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
|
|
bb0(%0 : @guaranteed $Builtin.NativeObject):
|
|
%1 = begin_borrow %0 : $Builtin.NativeObject
|
|
br bb1(%1 : $Builtin.NativeObject)
|
|
|
|
bb1(%2 : @guaranteed $Builtin.NativeObject):
|
|
end_borrow %2 : $Builtin.NativeObject
|
|
%4 = tuple()
|
|
return %4 : $()
|
|
}
|
|
|