xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2012-11-30-misched-dbg.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-macosx -enable-misched \
2*9880d681SAndroid Build Coastguard Worker; RUN:          -verify-machineinstrs | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker;
4*9880d681SAndroid Build Coastguard Worker; Test MachineScheduler handling of DBG_VALUE.
5*9880d681SAndroid Build Coastguard Worker; rdar://12776937.
6*9880d681SAndroid Build Coastguard Worker;
7*9880d681SAndroid Build Coastguard Worker; CHECK: %if.else581
8*9880d681SAndroid Build Coastguard Worker; CHECK: DEBUG_VALUE: num1
9*9880d681SAndroid Build Coastguard Worker; CHECK: call
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker%union.rec = type {}
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker@.str15 = external hidden unnamed_addr constant [6 x i8], align 1
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdefine i32 @AttachGalley(%union.rec** nocapture %suspend_pt) nounwind uwtable ssp !dbg !21 {
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker  %num14075 = alloca [20 x i8], align 16
20*9880d681SAndroid Build Coastguard Worker  br label %if.end33
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerif.end33:                                         ; preds = %entry
23*9880d681SAndroid Build Coastguard Worker  %cmp1733 = icmp eq i32 undef, 0
24*9880d681SAndroid Build Coastguard Worker  br label %if.else581
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workerif.else581:                                       ; preds = %if.end33
27*9880d681SAndroid Build Coastguard Worker  %cmp586 = icmp eq i8 undef, -123
28*9880d681SAndroid Build Coastguard Worker  br i1 %cmp586, label %if.then588, label %if.else594
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workerif.then588:                                       ; preds = %if.else581
31*9880d681SAndroid Build Coastguard Worker  br label %for.cond1710.preheader
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Workerif.else594:                                       ; preds = %if.else581
34*9880d681SAndroid Build Coastguard Worker  unreachable
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workerfor.cond1710.preheader:                           ; preds = %if.then588
37*9880d681SAndroid Build Coastguard Worker  br label %for.cond1710
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerfor.cond1710:                                     ; preds = %for.cond1710, %for.cond1710.preheader
40*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %for.cond1710, label %if.then3344
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Workerif.then3344:
43*9880d681SAndroid Build Coastguard Worker  br label %if.then4073
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Workerif.then4073:                                      ; preds = %if.then3344
46*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata [20 x i8]* %num14075, metadata !4, metadata !DIExpression()), !dbg !DILocation(scope: !5)
47*9880d681SAndroid Build Coastguard Worker  %arraydecay4078 = getelementptr inbounds [20 x i8], [20 x i8]* %num14075, i64 0, i64 0
48*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* undef, align 4
49*9880d681SAndroid Build Coastguard Worker  %add4093 = add nsw i32 %0, 0
50*9880d681SAndroid Build Coastguard Worker  %conv4094 = sitofp i32 %add4093 to float
51*9880d681SAndroid Build Coastguard Worker  %div4095 = fdiv float %conv4094, 5.670000e+02
52*9880d681SAndroid Build Coastguard Worker  %conv4096 = fpext float %div4095 to double
53*9880d681SAndroid Build Coastguard Worker  %call4097 = call i32 (i8*, i32, i64, i8*, ...) @__sprintf_chk(i8* %arraydecay4078, i32 0, i64 20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str15, i64 0, i64 0), double %conv4096) nounwind
54*9880d681SAndroid Build Coastguard Worker  br i1 %cmp1733, label %if.then4107, label %if.else4114
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Workerif.then4107:                                      ; preds = %if.then4073
57*9880d681SAndroid Build Coastguard Worker  unreachable
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Workerif.else4114:                                      ; preds = %if.then4073
60*9880d681SAndroid Build Coastguard Worker  unreachable
61*9880d681SAndroid Build Coastguard Worker}
62*9880d681SAndroid Build Coastguard Worker
63*9880d681SAndroid Build Coastguard Workerdeclare i32 @__sprintf_chk(i8*, i32, i64, i8*, ...)
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
66*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!35}
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 168918) (llvm/trunk 168920)", isOptimized: true, emissionKind: FullDebug, file: !19, enums: !2, retainedTypes: !2, globals: !2)
69*9880d681SAndroid Build Coastguard Worker!1 = !{!2}
70*9880d681SAndroid Build Coastguard Worker!2 = !{}
71*9880d681SAndroid Build Coastguard Worker!4 = !DILocalVariable(name: "num1", line: 815, scope: !5, file: !14, type: !15)
72*9880d681SAndroid Build Coastguard Worker!5 = distinct !DILexicalBlock(line: 815, column: 0, file: !14, scope: !6)
73*9880d681SAndroid Build Coastguard Worker!6 = distinct !DILexicalBlock(line: 812, column: 0, file: !14, scope: !7)
74*9880d681SAndroid Build Coastguard Worker!7 = distinct !DILexicalBlock(line: 807, column: 0, file: !14, scope: !8)
75*9880d681SAndroid Build Coastguard Worker!8 = distinct !DILexicalBlock(line: 440, column: 0, file: !14, scope: !9)
76*9880d681SAndroid Build Coastguard Worker!9 = distinct !DILexicalBlock(line: 435, column: 0, file: !14, scope: !10)
77*9880d681SAndroid Build Coastguard Worker!10 = distinct !DILexicalBlock(line: 434, column: 0, file: !14, scope: !11)
78*9880d681SAndroid Build Coastguard Worker!11 = distinct !DILexicalBlock(line: 250, column: 0, file: !14, scope: !12)
79*9880d681SAndroid Build Coastguard Worker!12 = distinct !DILexicalBlock(line: 249, column: 0, file: !14, scope: !13)
80*9880d681SAndroid Build Coastguard Worker!13 = distinct !DILexicalBlock(line: 221, column: 0, file: !14, scope: !21)
81*9880d681SAndroid Build Coastguard Worker!14 = !DIFile(filename: "MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c", directory: "MultiSource/Benchmarks/MiBench/consumer-typeset")
82*9880d681SAndroid Build Coastguard Worker!15 = !DICompositeType(tag: DW_TAG_array_type, size: 160, align: 8, baseType: !16, elements: !17)
83*9880d681SAndroid Build Coastguard Worker!16 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
84*9880d681SAndroid Build Coastguard Worker!17 = !{!18}
85*9880d681SAndroid Build Coastguard Worker!18 = !DISubrange(count: 20)
86*9880d681SAndroid Build Coastguard Worker!19 = !DIFile(filename: "MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c", directory: "MultiSource/Benchmarks/MiBench/consumer-typeset")
87*9880d681SAndroid Build Coastguard Worker
88*9880d681SAndroid Build Coastguard Worker!21 = distinct !DISubprogram(name: "AttachGalley", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 1, file: !19, scope: !14, type: !22)
89*9880d681SAndroid Build Coastguard Worker!22 = !DISubroutineType(types: !23)
90*9880d681SAndroid Build Coastguard Worker!23 = !{null}
91*9880d681SAndroid Build Coastguard Worker
92*9880d681SAndroid Build Coastguard Worker; Test DebugValue uses visited by RegisterPressureTracker findUseBetween().
93*9880d681SAndroid Build Coastguard Worker;
94*9880d681SAndroid Build Coastguard Worker; CHECK: @main
95*9880d681SAndroid Build Coastguard Worker; CHECK: DEBUG_VALUE: main:X
96*9880d681SAndroid Build Coastguard Worker; CHECK: call
97*9880d681SAndroid Build Coastguard Worker
98*9880d681SAndroid Build Coastguard Worker%"class.__gnu_cxx::hash_map" = type { %"class.__gnu_cxx::hashtable" }
99*9880d681SAndroid Build Coastguard Worker%"class.__gnu_cxx::hashtable" = type { i64, i64, i64, i64, i64, i64 }
100*9880d681SAndroid Build Coastguard Worker
101*9880d681SAndroid Build Coastguard Workerdefine void @main() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !37 {
102*9880d681SAndroid Build Coastguard Workerentry:
103*9880d681SAndroid Build Coastguard Worker  %X = alloca %"class.__gnu_cxx::hash_map", align 8
104*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %cond.true, label %cond.end
105*9880d681SAndroid Build Coastguard Worker
106*9880d681SAndroid Build Coastguard Workercond.true:                                        ; preds = %entry
107*9880d681SAndroid Build Coastguard Worker  unreachable
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard Workercond.end:                                         ; preds = %entry
110*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %"class.__gnu_cxx::hash_map"* %X, metadata !31, metadata !DIExpression()), !dbg !DILocation(scope: !37)
111*9880d681SAndroid Build Coastguard Worker  %_M_num_elements.i.i.i.i = getelementptr inbounds %"class.__gnu_cxx::hash_map", %"class.__gnu_cxx::hash_map"* %X, i64 0, i32 0, i32 5
112*9880d681SAndroid Build Coastguard Worker  invoke void @_Znwm()
113*9880d681SAndroid Build Coastguard Worker          to label %exit.i unwind label %lpad2.i.i.i.i
114*9880d681SAndroid Build Coastguard Worker
115*9880d681SAndroid Build Coastguard Workerexit.i:                                           ; preds = %cond.end
116*9880d681SAndroid Build Coastguard Worker  unreachable
117*9880d681SAndroid Build Coastguard Worker
118*9880d681SAndroid Build Coastguard Workerlpad2.i.i.i.i:                                    ; preds = %cond.end
119*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
120*9880d681SAndroid Build Coastguard Worker          cleanup
121*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %lpad.body.i.i, label %if.then.i.i.i.i.i.i.i.i
122*9880d681SAndroid Build Coastguard Worker
123*9880d681SAndroid Build Coastguard Workerif.then.i.i.i.i.i.i.i.i:                          ; preds = %lpad2.i.i.i.i
124*9880d681SAndroid Build Coastguard Worker  unreachable
125*9880d681SAndroid Build Coastguard Worker
126*9880d681SAndroid Build Coastguard Workerlpad.body.i.i:                                    ; preds = %lpad2.i.i.i.i
127*9880d681SAndroid Build Coastguard Worker  resume { i8*, i32 } %0
128*9880d681SAndroid Build Coastguard Worker}
129*9880d681SAndroid Build Coastguard Worker
130*9880d681SAndroid Build Coastguard Workerdeclare i32 @__gxx_personality_v0(...)
131*9880d681SAndroid Build Coastguard Worker
132*9880d681SAndroid Build Coastguard Workerdeclare void @_Znwm()
133*9880d681SAndroid Build Coastguard Worker
134*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!30}
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard Worker!30 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169129) (llvm/trunk 169135)", isOptimized: true, emissionKind: FullDebug, file: !34, enums: !2, retainedTypes: !2)
137*9880d681SAndroid Build Coastguard Worker!31 = !DILocalVariable(name: "X", line: 29, scope: !37, type: !32)
138*9880d681SAndroid Build Coastguard Worker!32 = !DIDerivedType(tag: DW_TAG_typedef, name: "HM", line: 28, file: !34, baseType: null)
139*9880d681SAndroid Build Coastguard Worker!33 = !DIFile(filename: "SingleSource/Benchmarks/Shootout-C++/hash.cpp", directory: "SingleSource/Benchmarks/Shootout-C++")
140*9880d681SAndroid Build Coastguard Worker!34 = !DIFile(filename: "SingleSource/Benchmarks/Shootout-C++/hash.cpp", directory: "SingleSource/Benchmarks/Shootout-C++")
141*9880d681SAndroid Build Coastguard Worker!35 = !{i32 1, !"Debug Info Version", i32 3}
142*9880d681SAndroid Build Coastguard Worker!37 = distinct !DISubprogram(name: "main", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !30, scopeLine: 1, file: !19, scope: !14, type: !22)
143