|
| 1 | +// RUN: %target-sil-opt -mandatory-generic-specializer %s | %FileCheck %s |
| 2 | + |
| 3 | +sil_stage canonical |
| 4 | + |
| 5 | +import Builtin |
| 6 | +import Swift |
| 7 | +import SwiftShims |
| 8 | + |
| 9 | +// CHECK-LABEL: sil [no_allocation] @deserialize_and_inline_after_devirtualize |
| 10 | +// CHECK-NOT: apply |
| 11 | +// CHECK: } // end sil function 'deserialize_and_inline_after_devirtualize' |
| 12 | +sil [no_allocation] @deserialize_and_inline_after_devirtualize : $@convention(thin) (@in Int) -> () { |
| 13 | +bb0(%0 : $*Int): |
| 14 | + %1 = metatype $@thick Int.Type |
| 15 | + %2 = witness_method $Int, #Comparable."<" : <Self where Self : Comparable> (Self.Type) -> (Self, Self) -> Bool : $@convention(witness_method: Comparable) <τ_0_0 where τ_0_0 : Comparable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0, @thick τ_0_0.Type) -> Bool |
| 16 | + %3 = apply %2<Int>(%0, %0, %1) : $@convention(witness_method: Comparable) <τ_0_0 where τ_0_0 : Comparable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0, @thick τ_0_0.Type) -> Bool |
| 17 | + %4 = tuple() |
| 18 | + return %4 : $() |
| 19 | +} |
| 20 | + |
| 21 | +// CHECK-LABEL: sil [no_allocation] @dont_do_dead_alloc_eimination_on_non_ossa |
| 22 | +// CHECK: alloc_stack |
| 23 | +// CHECK-NOT: load |
| 24 | +// CHECK: } // end sil function 'dont_do_dead_alloc_eimination_on_non_ossa' |
| 25 | +sil [no_allocation] @dont_do_dead_alloc_eimination_on_non_ossa : $@convention(thin) (Builtin.Int32) -> Builtin.Int32 { |
| 26 | +bb0(%0 : $Builtin.Int32): |
| 27 | + %1 = alloc_stack $Builtin.Int32 |
| 28 | + store %0 to %1 : $*Builtin.Int32 |
| 29 | + %2 = load %1 : $*Builtin.Int32 |
| 30 | + dealloc_stack %1 : $*Builtin.Int32 |
| 31 | + return %2 : $Builtin.Int32 |
| 32 | +} |
| 33 | + |
| 34 | +sil shared_external [transparent] [serialized] [thunk] [canonical] @$sSiSLsSL1loiySbx_xtFZTW : $@convention(witness_method: Comparable) (@in_guaranteed Int, @in_guaranteed Int, @thick Int.Type) -> Bool |
| 35 | + |
| 36 | +sil_witness_table public_external [serialized] Int: Comparable module Swift { |
| 37 | + base_protocol Equatable: Int: Equatable module Swift |
| 38 | + method #Comparable."<": <Self where Self : Comparable> (Self.Type) -> (Self, Self) -> Bool : @$sSiSLsSL1loiySbx_xtFZTW |
| 39 | +} |
| 40 | + |
0 commit comments