File: simple.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 (22 lines) | stat: -rw-r--r-- 1,032 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
// RUN: %target-swift-frontend %s -g -emit-ir -o - | %FileCheck %s

sil_stage canonical

import Builtin
import Swift

sil [ossa] @square : $@convention(thin) (Int32) -> Int32 {
bb0(%0 : $Int32):
  debug_value %0 : $Int32, let, name "x" // id: %1
  %3 = struct_extract %0 : $Int32, #Int32._value       // user: %6
  %4 = struct_extract %0 : $Int32, #Int32._value       // user: %6
  %5 = integer_literal $Builtin.Int1, -1          // user: %6
  %6 = builtin "smul_with_overflow_Int32"(%3 : $Builtin.Int32, %4 : $Builtin.Int32, %5 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1) // users: %7, %8
  %7 = tuple_extract %6 : $(Builtin.Int32, Builtin.Int1), 0 // user: %10
  %8 = tuple_extract %6 : $(Builtin.Int32, Builtin.Int1), 1 // user: %9
  cond_fail %8 : $Builtin.Int1                    // id: %9
  %10 = struct $Int32 (%7 : $Builtin.Int32)          // user: %11
  // CHECK: ret i32 %{{.*}}, !dbg ![[LOC:.*]]
  // CHECK: ![[LOC]] = !DILocation(line: [[@LINE+1]],
  return %10 : $Int32                               // id: %11
}