mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The Swift Simplification pass can do more than the old MandatoryCombine pass: simplification of more instruction types and dead code elimination. The result is a better -Onone performance while still keeping debug info consistent. Currently following code patterns are simplified: * `struct` -> `struct_extract` * `enum` -> `unchecked_enum_data` * `partial_apply` -> `apply` * `br` to a 1:1 related block * `cond_br` with a constant condition * `isConcrete` and `is_same_metadata` builtins More simplifications can be added in the future. rdar://96708429 rdar://104562580
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_public_non_abi.sil -Xllvm -sil-disable-pass=simplification
|
|
// RUN: %target-swift-frontend -emit-sil -I %t %s -Xllvm -sil-disable-pass=simplification | %FileCheck %s
|
|
|
|
sil_stage raw
|
|
|
|
import def_public_non_abi
|
|
import Builtin
|
|
import Swift
|
|
|
|
// CHECK-LABEL: sil @top_level_code
|
|
// CHECK: function_ref @public_non_abi_function : $@convention(thin) () -> ()
|
|
// CHECK: return
|
|
|
|
sil @top_level_code : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = function_ref @public_non_abi_function : $@convention(thin) () -> ()
|
|
%1 = tuple ()
|
|
return %1 : $()
|
|
}
|
|
|
|
// Make sure the function body is deserialized.
|
|
// CHECK-LABEL: sil shared @public_non_abi_function : $@convention(thin) () -> ()
|
|
// CHECK: function_ref @other_public_non_abi_function
|
|
// CHECK: return
|
|
sil hidden_external [serialized] @public_non_abi_function : $@convention(thin) () -> ()
|
|
|
|
// Make sure the function body is deserialized.
|
|
// CHECK-LABEL: sil shared @other_public_non_abi_function : $@convention(thin) () -> ()
|
|
// CHECK: return
|