File: combine-sext-debugloc.mir

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 (50 lines) | stat: -rw-r--r-- 1,858 bytes parent folder | download | duplicates (13)
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
# RUN: llc -O0 -verify-machineinstrs -mtriple aarch64-- -run-pass=legalizer %s -o - | FileCheck %s

# Check that when we combine SEXT we assign the correct debug location.
# CHECK: !9 = !DILocation(line: 36, column: 21, scope: !4)
# CHECK: G_AND %5, %4, debug-location !9

--- |
  target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
  target triple = "aarch64-unknown-unknown"
  
  define i64 @main(i8 %pat) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !4 {
  entry:
    %sext.1 = zext i8 %pat to i16, !dbg !8
    %sext.zext.1 = sext i16 %sext.1 to i64, !dbg !9
    ret i64 %sext.zext.1
  }
  
  declare void @printf(i8*, ...)
  
  declare i32 @__gxx_personality_v0(...)
  
  !llvm.dbg.cu = !{!0}
  !llvm.module.flags = !{!2, !3}
  
  !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, nameTableKind: None, sysroot: "/pata/tino", sdk: "iPhoneOS13.0.sdk")
  !1 = !DIFile(filename: "/pata/tino/main.cpp", directory: "/pata/tino")
  !2 = !{i32 2, !"Debug Info Version", i32 3}
  !3 = !{i32 7, !"PIC Level", i32 2}
  !4 = distinct !DISubprogram(name: "main", scope: !5, file: !5, line: 19, type: !6, scopeLine: 20, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
  !5 = !DIFile(filename: "main.cpp", directory: "/pata/tino")
  !6 = !DISubroutineType(types: !7)
  !7 = !{}
  !8 = !DILocation(line: 23, column: 5, scope: !4)
  !9 = !DILocation(line: 36, column: 21, scope: !4)

...
---
name:            main
body:             |
  bb.1.entry:
    liveins: $w0
  
    %1:_(s32) = COPY $w0
    %0:_(s8) = G_TRUNC %1(s32)
    %2:_(s16) = G_ZEXT %0(s8), debug-location !8
    %3:_(s64) = G_SEXT %2(s16), debug-location !9
    $x0 = COPY %3(s64)
    RET_ReallyLR implicit $x0

...