mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The `explicit_copy_value` and `explicit_copy_addr` instructions are only used for non-copyable diagnostics in the mandatory pipeline. After that we can replace them by their non-explicit counterparts so that optimizations (which only know of `copy_value` and `copy_addr`) can do their work. rdar://159039552
22 lines
846 B
Plaintext
22 lines
846 B
Plaintext
// RUN: %target-sil-opt -enable-sil-verify-all %s -onone-simplification -simplify-instruction=explicit_copy_value | %FileCheck %s --check-prefix=CHECK-ONONE --check-prefix=CHECK
|
|
// RUN: %target-sil-opt -enable-sil-verify-all %s -simplification -simplify-instruction=explicit_copy_value | %FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
|
|
sil_stage canonical
|
|
|
|
import Swift
|
|
import Builtin
|
|
|
|
// CHECK-LABEL: sil [ossa] @simplify_explicit_copy_value :
|
|
// CHECK-O: %1 = copy_value %0
|
|
// CHECK-ONONE: %1 = explicit_copy_value %0
|
|
// CHECK-NEXT: return %1
|
|
// CHECK: } // end sil function 'simplify_explicit_copy_value'
|
|
sil [ossa] @simplify_explicit_copy_value : $@convention(thin) (@guaranteed String) -> @owned String {
|
|
bb0(%0 : @guaranteed $String):
|
|
%1 = explicit_copy_value %0
|
|
return %1
|
|
}
|
|
|