File: sil_locations.sil

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (66 lines) | stat: -rw-r--r-- 3,848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// RUN: %target-sil-opt -sil-print-debuginfo -enable-sil-verify-all -mandatory-inlining -emit-verbose-sil %s | %FileCheck %s

import Builtin
import Swift

sil @plus : $@convention(thin) (Int64, Int64) -> Int64
sil @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64

// CHECK-LABEL: sil [transparent] @test_add : $@convention(thin) (Int64) -> Int64 {
sil [transparent] @test_add : $@convention(thin) (Int64) -> Int64 {
bb0(%0 : $Int64):
  %1 = alloc_box $<τ_0_0> { var τ_0_0 } <Int64>
  %1a = project_box %1 : $<τ_0_0> { var τ_0_0 } <Int64>, 0
  store %0 to %1a : $*Int64
  %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64
  %4 = load %1a : $*Int64
  %5 = function_ref @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
  %6 = metatype $@thin Int64.Type
  %7 = integer_literal $Builtin.Int128, 20
  %8 = apply %5(%7, %6) : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
  %9 = apply %3(%4, %8) : $@convention(thin) (Int64, Int64) -> Int64
  strong_release %1 : $<τ_0_0> { var τ_0_0 } <Int64>
  return %9 : $Int64
}

sil @inline_test_add : $@convention(thin) (Int64) -> Int64 {
bb0(%0 : $Int64):
  %1 = alloc_box $<τ_0_0> { var τ_0_0 } <Int64>
  %1a = project_box %1 : $<τ_0_0> { var τ_0_0 } <Int64>, 0
  store %0 to %1a : $*Int64
  %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64
  %4 = function_ref @test_add : $@convention(thin) (Int64) -> Int64
  %5 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64
  %6 = load %1a : $*Int64
  %7 = function_ref @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
  %8 = metatype $@thin Int64.Type
  %9 = integer_literal $Builtin.Int128, 10
  %10 = apply %7(%9, %8) : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
  %11 = apply %5(%6, %10) : $@convention(thin) (Int64, Int64) -> Int64
  %12 = apply %4(%11) : $@convention(thin) (Int64) -> Int64
  %13 = function_ref @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
  %14 = metatype $@thin Int64.Type
  %15 = integer_literal $Builtin.Int128, 30
  %16 = apply %13(%15, %14) : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
  %17 = apply %3(%12, %16) : $@convention(thin) (Int64, Int64) -> Int64
  strong_release %1 : $<τ_0_0> { var τ_0_0 } <Int64>
  return %17 : $Int64

  // CHECK-LABEL: sil @inline_test_add : $@convention(thin) (Int64) -> Int64 {
  // CHECK: [[VAL9:%.*]] = apply                               {{.*}} line:38:9:sil
  // CHECK: [[VAL10:%.*]] = apply                         {{.*}} line:39:9:sil
  // CHECK: [[VAL11:%.*]] = alloc_box $<τ_0_0> { var τ_0_0 } <Int64>,             {{.*}}compiler-generated
  // CHECK: [[PB11:%.*]] = project_box [[VAL11]]          {{.*}} line:40:9:minlined
  // CHECK: store [[VAL10]] to [[PB11]]                   {{.*}} line:40:9:minlined
  // CHECK: [[VAL13:%.*]] = function_ref @plus            {{.*}} line:40:9:minlined
  // CHECK: [[VAL14:%.*]] = load [[PB11]]                 {{.*}} line:40:9:minlined
  // CHECK: [[VAL15:%.*]] = function_ref @fromLiteral     {{.*}} line:40:9:minlined
  // CHECK: [[VAL16:%.*]] = metatype $@thin Int64.Type,   {{.*}} line:40:9:minlined
  // CHECK: [[VAL17:%.*]] = integer_literal $Builtin.Int128, 20,      {{.*}} line:40:9:minlined
  // CHECK: [[VAL18:%.*]] = apply [[VAL15]]([[VAL17]], [[VAL16]])     {{.*}} line:40:9:minlined
  // CHECK: [[VAL19:%.*]] = apply [[VAL13]]([[VAL14]], [[VAL18]])     {{.*}} line:40:9:minlined
  // CHECK: strong_release [[VAL11]]                      {{.*}} line:40:9:minlined
  // CHECK: [[VAL21:%.*]] = function_ref @fromLiteral     {{.*}} line:41:9
  // CHECK: [[VAL22:%.*]] = metatype $@thin Int64.Type,   {{.*}} line:42:9
  // CHECK: [[VAL23:%.*]] = integer_literal $Builtin.Int128, 30,      {{.*}} line:43:9
}