1 ; RUN: llc < %s -mtriple=x86_64-apple-macosx -enable-misched \
2 ; RUN: -verify-machineinstrs | FileCheck %s
4 ; Test MachineScheduler handling of DBG_VALUE.
8 ; CHECK: DEBUG_VALUE: num1
13 @.str15 = external hidden unnamed_addr constant [6 x i8], align 1
15 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
17 define i32 @AttachGalley(%union.rec** nocapture %suspend_pt) nounwind uwtable ssp {
19 %num14075 = alloca [20 x i8], align 16
22 if.end33: ; preds = %entry
23 %cmp1733 = icmp eq i32 undef, 0
26 if.else581: ; preds = %if.end33
27 %cmp586 = icmp eq i8 undef, -123
28 br i1 %cmp586, label %if.then588, label %if.else594
30 if.then588: ; preds = %if.else581
31 br label %for.cond1710.preheader
33 if.else594: ; preds = %if.else581
36 for.cond1710.preheader: ; preds = %if.then588
37 br label %for.cond1710
39 for.cond1710: ; preds = %for.cond1710, %for.cond1710.preheader
40 br i1 undef, label %for.cond1710, label %if.then3344
45 if.then4073: ; preds = %if.then3344
46 call void @llvm.dbg.declare(metadata [20 x i8]* %num14075, metadata !4, metadata !{!"0x102"})
47 %arraydecay4078 = getelementptr inbounds [20 x i8]* %num14075, i64 0, i64 0
48 %0 = load i32* undef, align 4
49 %add4093 = add nsw i32 %0, 0
50 %conv4094 = sitofp i32 %add4093 to float
51 %div4095 = fdiv float %conv4094, 5.670000e+02
52 %conv4096 = fpext float %div4095 to double
53 %call4097 = call i32 (i8*, i32, i64, i8*, ...)* @__sprintf_chk(i8* %arraydecay4078, i32 0, i64 20, i8* getelementptr inbounds ([6 x i8]* @.str15, i64 0, i64 0), double %conv4096) nounwind
54 br i1 %cmp1733, label %if.then4107, label %if.else4114
56 if.then4107: ; preds = %if.then4073
59 if.else4114: ; preds = %if.then4073
63 declare i32 @__sprintf_chk(i8*, i32, i64, i8*, ...)
66 !llvm.module.flags = !{!35}
68 !0 = !{!"0x11\0012\00clang version 3.3 (trunk 168918) (llvm/trunk 168920)\001\00\000\00\000", !19, !2, !2, !20, !2, null} ; [ DW_TAG_compile_unit ] [MultiSource/Benchmarks/MiBench/consumer-typeset/MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c] [DW_LANG_C99]
71 !4 = !{!"0x100\00num1\00815\000", !5, !14, !15} ; [ DW_TAG_auto_variable ] [num1] [line 815]
72 !5 = !{!"0xb\00815\000\00177", !14, !6} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
73 !6 = !{!"0xb\00812\000\00176", !14, !7} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
74 !7 = !{!"0xb\00807\000\00175", !14, !8} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
75 !8 = !{!"0xb\00440\000\0094", !14, !9} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
76 !9 = !{!"0xb\00435\000\0091", !14, !10} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
77 !10 = !{!"0xb\00434\000\0090", !14, !11} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
78 !11 = !{!"0xb\00250\000\0024", !14, !12} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
79 !12 = !{!"0xb\00249\000\0023", !14, !13} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
80 !13 = !{!"0xb\00221\000\0019", !14, !2} ; [ DW_TAG_lexical_block ] [MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c]
81 !14 = !{!"0x29", !19} ; [ DW_TAG_file_type ]
82 !15 = !{!"0x1\00\000\00160\008\000\000", null, null, !16, !17, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 160, align 8, offset 0] [from char]
83 !16 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
85 !18 = !{!"0x21\000\0020"} ; [ DW_TAG_subrange_type ] [0, 19]
86 !19 = !{!"MultiSource/Benchmarks/MiBench/consumer-typeset/z19.c", !"MultiSource/Benchmarks/MiBench/consumer-typeset"}
89 !21 = !{!"0x2e\00AttachGalley\00AttachGalley\00\000\000\001\000\006\00256\001\001", !19, !14, !22, null, i32 (%union.rec**)* @AttachGalley, null, null, null} ; [ DW_TAG_subprogram ] [def] [AttachGalley]
90 !22 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !23, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
93 ; Test DebugValue uses visited by RegisterPressureTracker findUseBetween().
96 ; CHECK: DEBUG_VALUE: X
99 %"class.__gnu_cxx::hash_map" = type { %"class.__gnu_cxx::hashtable" }
100 %"class.__gnu_cxx::hashtable" = type { i64, i64, i64, i64, i64, i64 }
102 define void @main() uwtable ssp {
104 %X = alloca %"class.__gnu_cxx::hash_map", align 8
105 br i1 undef, label %cond.true, label %cond.end
107 cond.true: ; preds = %entry
110 cond.end: ; preds = %entry
111 call void @llvm.dbg.declare(metadata %"class.__gnu_cxx::hash_map"* %X, metadata !31, metadata !{!"0x102"})
112 %_M_num_elements.i.i.i.i = getelementptr inbounds %"class.__gnu_cxx::hash_map"* %X, i64 0, i32 0, i32 5
114 to label %exit.i unwind label %lpad2.i.i.i.i
116 exit.i: ; preds = %cond.end
119 lpad2.i.i.i.i: ; preds = %cond.end
120 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
122 br i1 undef, label %lpad.body.i.i, label %if.then.i.i.i.i.i.i.i.i
124 if.then.i.i.i.i.i.i.i.i: ; preds = %lpad2.i.i.i.i
127 lpad.body.i.i: ; preds = %lpad2.i.i.i.i
128 resume { i8*, i32 } %0
131 declare i32 @__gxx_personality_v0(...)
133 declare void @_Znwm()
135 !llvm.dbg.cu = !{!30}
137 !30 = !{!"0x11\004\00clang version 3.3 (trunk 169129) (llvm/trunk 169135)\001\00\000\00\000", !34, !2, !2, !36, null, null} ; [ DW_TAG_compile_unit ] [SingleSource/Benchmarks/Shootout-C++/hash.cpp] [DW_LANG_C_plus_plus]
138 !31 = !{!"0x100\00X\0029\000", null, null, !32} ; [ DW_TAG_auto_variable ] [X] [line 29]
139 !32 = !{!"0x16\00HM\0028\000\000\000\000", !34, null, null} ; [ DW_TAG_typedef ] [HM] [line 28, size 0, align 0, offset 0] [from ]
140 !33 = !{!"0x29", !34} ; [ DW_TAG_file_type ]
141 !34 = !{!"SingleSource/Benchmarks/Shootout-C++/hash.cpp", !"SingleSource/Benchmarks/Shootout-C++"}
142 !35 = !{i32 1, !"Debug Info Version", i32 2}
144 !37 = !{!"0x2e\00main\00main\00\000\000\001\000\006\00256\001\001", !19, !14, !22, null, void ()* @main, null, null, null} ; [ DW_TAG_subprogram ] [def] [main]