xref: /llvm-project/llvm/test/DebugInfo/ARM/move-dbg-value-same-reg.mir (revision a971bc38cee892fb490b806eec74f2188fb70416)
1*a971bc38SShubham Sandeep Rastogi# RUN: llc %s -start-after=arm-mve-vpt-opts -stop-after=arm-prera-ldst-opt -o - | FileCheck %s
2*a971bc38SShubham Sandeep Rastogi# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !{{[0-9]+}}
3*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: DBG_VALUE 0, $noreg, ![[DBG:[0-9]+]], !DIExpression(), debug-location !{{[0-9]+}}
4*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: DBG_VALUE $noreg, $noreg, ![[DBG]], !DIExpression(), debug-location !{{[0-9]+}}
5*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !{{[0-9]+}}, !DIExpression(), debug-location !{{[0-9]+}}
6*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !{{[0-9]+}} :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
7*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: DBG_VALUE %0, $noreg, ![[DBG]], !DIExpression(), debug-location !{{[0-9]+}}
8*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: DBG_VALUE %0, $noreg, !{{[0-9]+}}, !DIExpression(), debug-location !{{[0-9]+}}
9*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !{{[0-9]+}} :: (load (s32) from %ir.btc_user_copy)
10*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !{{[0-9]+}} :: (load (s32) from %ir.btc_user_copy_context, align 8)
11*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: %7:rgpr = t2ANDrr %6, %0, 14 /* CC::al */, $noreg, def $cpsr
12*a971bc38SShubham Sandeep Rastogi# CHECK-NEXT: DBG_VALUE %2, $noreg, ![[DBG]], !DIExpression(), debug-location !{{[0-9]+}}
13*a971bc38SShubham Sandeep Rastogi
14*a971bc38SShubham Sandeep Rastogi# This test checks the case where two DBG_VALUEs share the same virtual register but describe different local variables.
15*a971bc38SShubham Sandeep Rastogi
16*a971bc38SShubham Sandeep Rastogi--- |
17*a971bc38SShubham Sandeep Rastogi  target triple = "thumbv7k-apple-watchos8.0.0"
18*a971bc38SShubham Sandeep Rastogi  %struct.backtrace_control = type {}
19*a971bc38SShubham Sandeep Rastogi  @backtrace_user.ctl_default = internal unnamed_addr constant %struct.backtrace_control zeroinitializer, !dbg !0
20*a971bc38SShubham Sandeep Rastogi  define i32 @backtrace_user(ptr nocapture noundef writeonly %bt, i32 noundef %max_frames, ptr noundef readonly %ctl_in, ptr nocapture noundef readnone %info_out) local_unnamed_addr #0 !dbg !2 {entry:
21*a971bc38SShubham Sandeep Rastogi    %tobool.not = icmp eq ptr %ctl_in, null, !dbg !95
22*a971bc38SShubham Sandeep Rastogi    %.backtrace_user.ctl_default = select i1 %tobool.not, ptr @backtrace_user.ctl_default, ptr %ctl_in, !dbg !95
23*a971bc38SShubham Sandeep Rastogi    %btc_user_copy = getelementptr inbounds %struct.backtrace_control, ptr %.backtrace_user.ctl_default, !dbg !95
24*a971bc38SShubham Sandeep Rastogi    %btc_user_copy_context = getelementptr inbounds %struct.backtrace_control, ptr %.backtrace_user.ctl_default, !dbg !95
25*a971bc38SShubham Sandeep Rastogi    ret i32 undef, !dbg !95
26*a971bc38SShubham Sandeep Rastogi  }
27*a971bc38SShubham Sandeep Rastogi  !llvm.module.flags = !{!88, !93}
28*a971bc38SShubham Sandeep Rastogi  !llvm.dbg.cu = !{!32}
29*a971bc38SShubham Sandeep Rastogi  !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
30*a971bc38SShubham Sandeep Rastogi  !1 = distinct !DIGlobalVariable(type: !11, isDefinition: true)
31*a971bc38SShubham Sandeep Rastogi  !2 = distinct !DISubprogram(unit: !32, retainedNodes: !38)
32*a971bc38SShubham Sandeep Rastogi  !3 = !DIFile(filename: "backtrace.pp.c", directory: "/Users/shubham/Development/Delta")
33*a971bc38SShubham Sandeep Rastogi  !11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !12)
34*a971bc38SShubham Sandeep Rastogi  !12 = distinct !DICompositeType(tag: DW_TAG_member, offset: 32)
35*a971bc38SShubham Sandeep Rastogi  !16 = !DIDerivedType(tag: DW_TAG_typedef, baseType: !21)
36*a971bc38SShubham Sandeep Rastogi  !21 = !DIBasicType()
37*a971bc38SShubham Sandeep Rastogi  !32 = distinct !DICompileUnit(language: DW_LANG_C11, file: !33, sdk: "MacOSX13.0.sdk")
38*a971bc38SShubham Sandeep Rastogi  !33 = !DIFile(filename: "/Users/shubham/Development/Delta/backtrace.pp.c", directory: "/Users/shubham/Development/Delta")
39*a971bc38SShubham Sandeep Rastogi  !38 = !{!59, !60, !85}
40*a971bc38SShubham Sandeep Rastogi  !59 = !DILocalVariable(scope: !2, type: !16)
41*a971bc38SShubham Sandeep Rastogi  !60 = !DILocalVariable(scope: !2, type: !62)
42*a971bc38SShubham Sandeep Rastogi  !62 = distinct !DICompositeType(tag: DW_TAG_union_type, size: 128)
43*a971bc38SShubham Sandeep Rastogi  !85 = !DILabel(scope: !2, name: "out", file: !3, line: 102)
44*a971bc38SShubham Sandeep Rastogi  !88 = !{i32 2, !"Debug Info Version", i32 3}
45*a971bc38SShubham Sandeep Rastogi  !93 = !{i32 7, !"frame-pointer", i32 1}
46*a971bc38SShubham Sandeep Rastogi  !95 = !DILocation(line: 5, column: 10, scope: !2)
47*a971bc38SShubham Sandeep Rastoginame:            backtrace_user
48*a971bc38SShubham Sandeep Rastogiregisters:
49*a971bc38SShubham Sandeep Rastogi  - {id: 0, class: rgpr, }
50*a971bc38SShubham Sandeep Rastogi  - {id: 1, class: gpr, }
51*a971bc38SShubham Sandeep Rastogi  - {id: 2, class: gpr, }
52*a971bc38SShubham Sandeep Rastogibody:             |
53*a971bc38SShubham Sandeep Rastogi  bb.0.entry:
54*a971bc38SShubham Sandeep Rastogi    %10:rgpr = COPY $r2
55*a971bc38SShubham Sandeep Rastogi    %13:rgpr = t2MOV_ga_pcrel target-flags(arm-nonlazy) @backtrace_user.ctl_default, debug-location !95
56*a971bc38SShubham Sandeep Rastogi    %15:rgpr = t2MOVCCr %10, killed %13, 0 /* CC::eq */, $cpsr, debug-location !95
57*a971bc38SShubham Sandeep Rastogi    DBG_VALUE 0, $noreg, !60, !DIExpression(), debug-location !95
58*a971bc38SShubham Sandeep Rastogi    %0:rgpr = t2LDRi12 %15, 0, 14 /* CC::al */, $noreg, debug-location !95 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
59*a971bc38SShubham Sandeep Rastogi    DBG_VALUE %0, $noreg, !60, !DIExpression(), debug-location !95
60*a971bc38SShubham Sandeep Rastogi    DBG_VALUE %0, $noreg, !59, !DIExpression(), debug-location !95
61*a971bc38SShubham Sandeep Rastogi    %16:rgpr = t2LDRi12 %15, 4, 14 /* CC::al */, $noreg, debug-location !95 :: (load (s32) from %ir.btc_user_copy)
62*a971bc38SShubham Sandeep Rastogi    %2:gpr = t2LDRi12 %15, 8, 14 /* CC::al */, $noreg, debug-location !95 :: (load (s32) from %ir.btc_user_copy_context, align 8)
63*a971bc38SShubham Sandeep Rastogi    %31:rgpr = t2ANDrr %16, %0, 14 /* CC::al */, $noreg, def $cpsr
64*a971bc38SShubham Sandeep Rastogi    DBG_VALUE %2, $noreg, !60, !DIExpression(), debug-location !95
65