1 ; RUN: llc -mtriple=x86_64-pc-linux -O2 < %s | FileCheck %s 2 ; RUN: llc -mtriple=x86_64-pc-linux -O2 -regalloc=basic < %s | FileCheck %s 3 ; Test to check .debug_loc support. This test case emits many debug_loc entries. 4 5 ; CHECK: Loc expr size 6 ; CHECK-NEXT: .short 7 ; CHECK-NEXT: .Ltmp 8 ; CHECK-NEXT: DW_OP_reg 9 10 %0 = type { double } 11 12 define hidden %0 @__divsc3(float %a, float %b, float %c, float %d) nounwind readnone { 13 entry: 14 tail call void @llvm.dbg.value(metadata !{float %a}, i64 0, metadata !0) 15 tail call void @llvm.dbg.value(metadata !{float %b}, i64 0, metadata !11) 16 tail call void @llvm.dbg.value(metadata !{float %c}, i64 0, metadata !12) 17 tail call void @llvm.dbg.value(metadata !{float %d}, i64 0, metadata !13) 18 %0 = tail call float @fabsf(float %c) nounwind readnone, !dbg !19 ; <float> [#uses=1] 19 %1 = tail call float @fabsf(float %d) nounwind readnone, !dbg !19 ; <float> [#uses=1] 20 %2 = fcmp olt float %0, %1, !dbg !19 ; <i1> [#uses=1] 21 br i1 %2, label %bb, label %bb1, !dbg !19 22 23 bb: ; preds = %entry 24 %3 = fdiv float %c, %d, !dbg !20 ; <float> [#uses=3] 25 tail call void @llvm.dbg.value(metadata !{float %3}, i64 0, metadata !16), !dbg !20 26 %4 = fmul float %3, %c, !dbg !21 ; <float> [#uses=1] 27 %5 = fadd float %4, %d, !dbg !21 ; <float> [#uses=2] 28 tail call void @llvm.dbg.value(metadata !{float %5}, i64 0, metadata !14), !dbg !21 29 %6 = fmul float %3, %a, !dbg !22 ; <float> [#uses=1] 30 %7 = fadd float %6, %b, !dbg !22 ; <float> [#uses=1] 31 %8 = fdiv float %7, %5, !dbg !22 ; <float> [#uses=1] 32 tail call void @llvm.dbg.value(metadata !{float %8}, i64 0, metadata !17), !dbg !22 33 %9 = fmul float %3, %b, !dbg !23 ; <float> [#uses=1] 34 %10 = fsub float %9, %a, !dbg !23 ; <float> [#uses=1] 35 %11 = fdiv float %10, %5, !dbg !23 ; <float> [#uses=1] 36 tail call void @llvm.dbg.value(metadata !{float %11}, i64 0, metadata !18), !dbg !23 37 br label %bb2, !dbg !23 38 39 bb1: ; preds = %entry 40 %12 = fdiv float %d, %c, !dbg !24 ; <float> [#uses=3] 41 tail call void @llvm.dbg.value(metadata !{float %12}, i64 0, metadata !16), !dbg !24 42 %13 = fmul float %12, %d, !dbg !25 ; <float> [#uses=1] 43 %14 = fadd float %13, %c, !dbg !25 ; <float> [#uses=2] 44 tail call void @llvm.dbg.value(metadata !{float %14}, i64 0, metadata !14), !dbg !25 45 %15 = fmul float %12, %b, !dbg !26 ; <float> [#uses=1] 46 %16 = fadd float %15, %a, !dbg !26 ; <float> [#uses=1] 47 %17 = fdiv float %16, %14, !dbg !26 ; <float> [#uses=1] 48 tail call void @llvm.dbg.value(metadata !{float %17}, i64 0, metadata !17), !dbg !26 49 %18 = fmul float %12, %a, !dbg !27 ; <float> [#uses=1] 50 %19 = fsub float %b, %18, !dbg !27 ; <float> [#uses=1] 51 %20 = fdiv float %19, %14, !dbg !27 ; <float> [#uses=1] 52 tail call void @llvm.dbg.value(metadata !{float %20}, i64 0, metadata !18), !dbg !27 53 br label %bb2, !dbg !27 54 55 bb2: ; preds = %bb1, %bb 56 %y.0 = phi float [ %11, %bb ], [ %20, %bb1 ] ; <float> [#uses=5] 57 %x.0 = phi float [ %8, %bb ], [ %17, %bb1 ] ; <float> [#uses=5] 58 %21 = fcmp uno float %x.0, 0.000000e+00, !dbg !28 ; <i1> [#uses=1] 59 %22 = fcmp uno float %y.0, 0.000000e+00, !dbg !28 ; <i1> [#uses=1] 60 %or.cond = and i1 %21, %22 ; <i1> [#uses=1] 61 br i1 %or.cond, label %bb4, label %bb46, !dbg !28 62 63 bb4: ; preds = %bb2 64 %23 = fcmp une float %c, 0.000000e+00, !dbg !29 ; <i1> [#uses=1] 65 %24 = fcmp une float %d, 0.000000e+00, !dbg !29 ; <i1> [#uses=1] 66 %or.cond93 = or i1 %23, %24 ; <i1> [#uses=1] 67 br i1 %or.cond93, label %bb9, label %bb6, !dbg !29 68 69 bb6: ; preds = %bb4 70 %25 = fcmp uno float %a, 0.000000e+00, !dbg !29 ; <i1> [#uses=1] 71 %26 = fcmp uno float %b, 0.000000e+00, !dbg !29 ; <i1> [#uses=1] 72 %or.cond94 = and i1 %25, %26 ; <i1> [#uses=1] 73 br i1 %or.cond94, label %bb9, label %bb8, !dbg !29 74 75 bb8: ; preds = %bb6 76 %27 = tail call float @copysignf(float 0x7FF0000000000000, float %c) nounwind readnone, !dbg !30 ; <float> [#uses=2] 77 %28 = fmul float %27, %a, !dbg !30 ; <float> [#uses=1] 78 tail call void @llvm.dbg.value(metadata !{float %28}, i64 0, metadata !17), !dbg !30 79 %29 = fmul float %27, %b, !dbg !31 ; <float> [#uses=1] 80 tail call void @llvm.dbg.value(metadata !{float %29}, i64 0, metadata !18), !dbg !31 81 br label %bb46, !dbg !31 82 83 bb9: ; preds = %bb6, %bb4 84 %30 = fcmp ord float %a, 0.000000e+00 ; <i1> [#uses=1] 85 %31 = fsub float %a, %a, !dbg !32 ; <float> [#uses=3] 86 %32 = fcmp uno float %31, 0.000000e+00 ; <i1> [#uses=1] 87 %33 = and i1 %30, %32, !dbg !32 ; <i1> [#uses=2] 88 br i1 %33, label %bb14, label %bb11, !dbg !32 89 90 bb11: ; preds = %bb9 91 %34 = fcmp ord float %b, 0.000000e+00 ; <i1> [#uses=1] 92 %35 = fsub float %b, %b, !dbg !32 ; <float> [#uses=1] 93 %36 = fcmp uno float %35, 0.000000e+00 ; <i1> [#uses=1] 94 %37 = and i1 %34, %36, !dbg !32 ; <i1> [#uses=1] 95 br i1 %37, label %bb14, label %bb27, !dbg !32 96 97 bb14: ; preds = %bb11, %bb9 98 %38 = fsub float %c, %c, !dbg !32 ; <float> [#uses=1] 99 %39 = fcmp ord float %38, 0.000000e+00 ; <i1> [#uses=1] 100 br i1 %39, label %bb15, label %bb27, !dbg !32 101 102 bb15: ; preds = %bb14 103 %40 = fsub float %d, %d, !dbg !32 ; <float> [#uses=1] 104 %41 = fcmp ord float %40, 0.000000e+00 ; <i1> [#uses=1] 105 br i1 %41, label %bb16, label %bb27, !dbg !32 106 107 bb16: ; preds = %bb15 108 %iftmp.0.0 = select i1 %33, float 1.000000e+00, float 0.000000e+00 ; <float> [#uses=1] 109 %42 = tail call float @copysignf(float %iftmp.0.0, float %a) nounwind readnone, !dbg !33 ; <float> [#uses=2] 110 tail call void @llvm.dbg.value(metadata !{float %42}, i64 0, metadata !0), !dbg !33 111 %43 = fcmp ord float %b, 0.000000e+00 ; <i1> [#uses=1] 112 %44 = fsub float %b, %b, !dbg !34 ; <float> [#uses=1] 113 %45 = fcmp uno float %44, 0.000000e+00 ; <i1> [#uses=1] 114 %46 = and i1 %43, %45, !dbg !34 ; <i1> [#uses=1] 115 %iftmp.1.0 = select i1 %46, float 1.000000e+00, float 0.000000e+00 ; <float> [#uses=1] 116 %47 = tail call float @copysignf(float %iftmp.1.0, float %b) nounwind readnone, !dbg !34 ; <float> [#uses=2] 117 tail call void @llvm.dbg.value(metadata !{float %47}, i64 0, metadata !11), !dbg !34 118 %48 = fmul float %42, %c, !dbg !35 ; <float> [#uses=1] 119 %49 = fmul float %47, %d, !dbg !35 ; <float> [#uses=1] 120 %50 = fadd float %48, %49, !dbg !35 ; <float> [#uses=1] 121 %51 = fmul float %50, 0x7FF0000000000000, !dbg !35 ; <float> [#uses=1] 122 tail call void @llvm.dbg.value(metadata !{float %51}, i64 0, metadata !17), !dbg !35 123 %52 = fmul float %47, %c, !dbg !36 ; <float> [#uses=1] 124 %53 = fmul float %42, %d, !dbg !36 ; <float> [#uses=1] 125 %54 = fsub float %52, %53, !dbg !36 ; <float> [#uses=1] 126 %55 = fmul float %54, 0x7FF0000000000000, !dbg !36 ; <float> [#uses=1] 127 tail call void @llvm.dbg.value(metadata !{float %55}, i64 0, metadata !18), !dbg !36 128 br label %bb46, !dbg !36 129 130 bb27: ; preds = %bb15, %bb14, %bb11 131 %56 = fcmp ord float %c, 0.000000e+00 ; <i1> [#uses=1] 132 %57 = fsub float %c, %c, !dbg !37 ; <float> [#uses=1] 133 %58 = fcmp uno float %57, 0.000000e+00 ; <i1> [#uses=1] 134 %59 = and i1 %56, %58, !dbg !37 ; <i1> [#uses=2] 135 br i1 %59, label %bb33, label %bb30, !dbg !37 136 137 bb30: ; preds = %bb27 138 %60 = fcmp ord float %d, 0.000000e+00 ; <i1> [#uses=1] 139 %61 = fsub float %d, %d, !dbg !37 ; <float> [#uses=1] 140 %62 = fcmp uno float %61, 0.000000e+00 ; <i1> [#uses=1] 141 %63 = and i1 %60, %62, !dbg !37 ; <i1> [#uses=1] 142 %64 = fcmp ord float %31, 0.000000e+00 ; <i1> [#uses=1] 143 %or.cond95 = and i1 %63, %64 ; <i1> [#uses=1] 144 br i1 %or.cond95, label %bb34, label %bb46, !dbg !37 145 146 bb33: ; preds = %bb27 147 %.old = fcmp ord float %31, 0.000000e+00 ; <i1> [#uses=1] 148 br i1 %.old, label %bb34, label %bb46, !dbg !37 149 150 bb34: ; preds = %bb33, %bb30 151 %65 = fsub float %b, %b, !dbg !37 ; <float> [#uses=1] 152 %66 = fcmp ord float %65, 0.000000e+00 ; <i1> [#uses=1] 153 br i1 %66, label %bb35, label %bb46, !dbg !37 154 155 bb35: ; preds = %bb34 156 %iftmp.2.0 = select i1 %59, float 1.000000e+00, float 0.000000e+00 ; <float> [#uses=1] 157 %67 = tail call float @copysignf(float %iftmp.2.0, float %c) nounwind readnone, !dbg !38 ; <float> [#uses=2] 158 tail call void @llvm.dbg.value(metadata !{float %67}, i64 0, metadata !12), !dbg !38 159 %68 = fcmp ord float %d, 0.000000e+00 ; <i1> [#uses=1] 160 %69 = fsub float %d, %d, !dbg !39 ; <float> [#uses=1] 161 %70 = fcmp uno float %69, 0.000000e+00 ; <i1> [#uses=1] 162 %71 = and i1 %68, %70, !dbg !39 ; <i1> [#uses=1] 163 %iftmp.3.0 = select i1 %71, float 1.000000e+00, float 0.000000e+00 ; <float> [#uses=1] 164 %72 = tail call float @copysignf(float %iftmp.3.0, float %d) nounwind readnone, !dbg !39 ; <float> [#uses=2] 165 tail call void @llvm.dbg.value(metadata !{float %72}, i64 0, metadata !13), !dbg !39 166 %73 = fmul float %67, %a, !dbg !40 ; <float> [#uses=1] 167 %74 = fmul float %72, %b, !dbg !40 ; <float> [#uses=1] 168 %75 = fadd float %73, %74, !dbg !40 ; <float> [#uses=1] 169 %76 = fmul float %75, 0.000000e+00, !dbg !40 ; <float> [#uses=1] 170 tail call void @llvm.dbg.value(metadata !{float %76}, i64 0, metadata !17), !dbg !40 171 %77 = fmul float %67, %b, !dbg !41 ; <float> [#uses=1] 172 %78 = fmul float %72, %a, !dbg !41 ; <float> [#uses=1] 173 %79 = fsub float %77, %78, !dbg !41 ; <float> [#uses=1] 174 %80 = fmul float %79, 0.000000e+00, !dbg !41 ; <float> [#uses=1] 175 tail call void @llvm.dbg.value(metadata !{float %80}, i64 0, metadata !18), !dbg !41 176 br label %bb46, !dbg !41 177 178 bb46: ; preds = %bb35, %bb34, %bb33, %bb30, %bb16, %bb8, %bb2 179 %y.1 = phi float [ %80, %bb35 ], [ %y.0, %bb34 ], [ %y.0, %bb33 ], [ %y.0, %bb30 ], [ %55, %bb16 ], [ %29, %bb8 ], [ %y.0, %bb2 ] ; <float> [#uses=2] 180 %x.1 = phi float [ %76, %bb35 ], [ %x.0, %bb34 ], [ %x.0, %bb33 ], [ %x.0, %bb30 ], [ %51, %bb16 ], [ %28, %bb8 ], [ %x.0, %bb2 ] ; <float> [#uses=1] 181 %81 = fmul float %y.1, 0.000000e+00, !dbg !42 ; <float> [#uses=1] 182 %82 = fadd float %y.1, 0.000000e+00, !dbg !42 ; <float> [#uses=1] 183 %tmpr = fadd float %x.1, %81, !dbg !42 ; <float> [#uses=1] 184 %tmp89 = bitcast float %tmpr to i32 ; <i32> [#uses=1] 185 %tmp90 = zext i32 %tmp89 to i64 ; <i64> [#uses=1] 186 %tmp85 = bitcast float %82 to i32 ; <i32> [#uses=1] 187 %tmp86 = zext i32 %tmp85 to i64 ; <i64> [#uses=1] 188 %tmp87 = shl i64 %tmp86, 32 ; <i64> [#uses=1] 189 %ins = or i64 %tmp90, %tmp87 ; <i64> [#uses=1] 190 %tmp84 = bitcast i64 %ins to double ; <double> [#uses=1] 191 %mrv75 = insertvalue %0 undef, double %tmp84, 0, !dbg !42 ; <%0> [#uses=1] 192 ret %0 %mrv75, !dbg !42 193 } 194 195 declare float @fabsf(float) 196 197 declare float @copysignf(float, float) nounwind readnone 198 199 declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone 200 201 !llvm.dbg.cu = !{!3} 202 203 !0 = metadata !{i32 786689, metadata !1, metadata !"a", metadata !2, i32 1921, metadata !9, i32 0, null} ; [ DW_TAG_arg_variable ] 204 !1 = metadata !{i32 786478, metadata !45, metadata !2, metadata !"__divsc3", metadata !"__divsc3", metadata !"__divsc3", i32 1922, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true, %0 (float, float, float, float)* @__divsc3, null, null, metadata !43, i32 1922} ; [ DW_TAG_subprogram ] 205 !2 = metadata !{i32 786473, metadata !45} ; [ DW_TAG_file_type ] 206 !3 = metadata !{i32 786449, metadata !45, i32 1, metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, metadata !"", i32 0, metadata !47, metadata !47, metadata !44, null, null, metadata !""} ; [ DW_TAG_compile_unit ] 207 !4 = metadata !{i32 786453, metadata !45, metadata !2, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ] 208 !5 = metadata !{metadata !6, metadata !9, metadata !9, metadata !9, metadata !9} 209 !6 = metadata !{i32 786454, metadata !46, metadata !7, metadata !"SCtype", i32 170, i64 0, i64 0, i64 0, i32 0, metadata !8} ; [ DW_TAG_typedef ] 210 !7 = metadata !{i32 786473, metadata !46} ; [ DW_TAG_file_type ] 211 !8 = metadata !{i32 786468, metadata !45, metadata !2, metadata !"complex float", i32 0, i64 64, i64 32, i64 0, i32 0, i32 3} ; [ DW_TAG_base_type ] 212 !9 = metadata !{i32 786454, metadata !46, metadata !7, metadata !"SFtype", i32 167, i64 0, i64 0, i64 0, i32 0, metadata !10} ; [ DW_TAG_typedef ] 213 !10 = metadata !{i32 786468, metadata !45, metadata !2, metadata !"float", i32 0, i64 32, i64 32, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] 214 !11 = metadata !{i32 786689, metadata !1, metadata !"b", metadata !2, i32 1921, metadata !9, i32 0, null} ; [ DW_TAG_arg_variable ] 215 !12 = metadata !{i32 786689, metadata !1, metadata !"c", metadata !2, i32 1921, metadata !9, i32 0, null} ; [ DW_TAG_arg_variable ] 216 !13 = metadata !{i32 786689, metadata !1, metadata !"d", metadata !2, i32 1921, metadata !9, i32 0, null} ; [ DW_TAG_arg_variable ] 217 !14 = metadata !{i32 786688, metadata !15, metadata !"denom", metadata !2, i32 1923, metadata !9, i32 0, null} ; [ DW_TAG_auto_variable ] 218 !15 = metadata !{i32 786443, metadata !45, metadata !1, i32 1922, i32 0, i32 0} ; [ DW_TAG_lexical_block ] 219 !16 = metadata !{i32 786688, metadata !15, metadata !"ratio", metadata !2, i32 1923, metadata !9, i32 0, null} ; [ DW_TAG_auto_variable ] 220 !17 = metadata !{i32 786688, metadata !15, metadata !"x", metadata !2, i32 1923, metadata !9, i32 0, null} ; [ DW_TAG_auto_variable ] 221 !18 = metadata !{i32 786688, metadata !15, metadata !"y", metadata !2, i32 1923, metadata !9, i32 0, null} ; [ DW_TAG_auto_variable ] 222 !19 = metadata !{i32 1929, i32 0, metadata !15, null} 223 !20 = metadata !{i32 1931, i32 0, metadata !15, null} 224 !21 = metadata !{i32 1932, i32 0, metadata !15, null} 225 !22 = metadata !{i32 1933, i32 0, metadata !15, null} 226 !23 = metadata !{i32 1934, i32 0, metadata !15, null} 227 !24 = metadata !{i32 1938, i32 0, metadata !15, null} 228 !25 = metadata !{i32 1939, i32 0, metadata !15, null} 229 !26 = metadata !{i32 1940, i32 0, metadata !15, null} 230 !27 = metadata !{i32 1941, i32 0, metadata !15, null} 231 !28 = metadata !{i32 1946, i32 0, metadata !15, null} 232 !29 = metadata !{i32 1948, i32 0, metadata !15, null} 233 !30 = metadata !{i32 1950, i32 0, metadata !15, null} 234 !31 = metadata !{i32 1951, i32 0, metadata !15, null} 235 !32 = metadata !{i32 1953, i32 0, metadata !15, null} 236 !33 = metadata !{i32 1955, i32 0, metadata !15, null} 237 !34 = metadata !{i32 1956, i32 0, metadata !15, null} 238 !35 = metadata !{i32 1957, i32 0, metadata !15, null} 239 !36 = metadata !{i32 1958, i32 0, metadata !15, null} 240 !37 = metadata !{i32 1960, i32 0, metadata !15, null} 241 !38 = metadata !{i32 1962, i32 0, metadata !15, null} 242 !39 = metadata !{i32 1963, i32 0, metadata !15, null} 243 !40 = metadata !{i32 1964, i32 0, metadata !15, null} 244 !41 = metadata !{i32 1965, i32 0, metadata !15, null} 245 !42 = metadata !{i32 1969, i32 0, metadata !15, null} 246 !43 = metadata !{metadata !0, metadata !11, metadata !12, metadata !13, metadata !14, metadata !16, metadata !17, metadata !18} 247 !44 = metadata !{metadata !1} 248 !45 = metadata !{metadata !"libgcc2.c", metadata !"/Users/yash/clean/LG.D/gcc/../../llvmgcc/gcc"} 249 !46 = metadata !{metadata !"libgcc2.h", metadata !"/Users/yash/clean/LG.D/gcc/../../llvmgcc/gcc"} 250 !47 = metadata !{i32 0} 251