106 lines · plain
1; RUN: llc < %s | FileCheck %s2target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"3target triple = "x86_64-apple-darwin10.0.0"4; PR 98795 6; CHECK: ##DEBUG_VALUE: tid <-7%0 = type { ptr, ptr, ptr, ptr, i32 }8 9@sgv = internal addrspace(2) constant [1 x i8] zeroinitializer10@fgv = internal addrspace(2) constant [1 x i8] zeroinitializer11@lvgv = internal constant [0 x ptr] zeroinitializer12@llvm.global.annotations = appending global [1 x %0] [%0 { ptr @__OpenCL_nbt02_kernel, ptr addrspacecast (ptr addrspace(2) @sgv to ptr), ptr addrspacecast (ptr addrspace(2) @fgv to ptr), ptr @lvgv, i32 0 }], section "llvm.metadata"13 14define void @__OpenCL_nbt02_kernel(ptr addrspace(1) %ip) nounwind !dbg !0 {15entry:16 call void @llvm.dbg.value(metadata ptr addrspace(1) %ip, metadata !8, metadata !DIExpression()), !dbg !917 %0 = call <4 x i32> @__amdil_get_local_id_int() nounwind18 %1 = extractelement <4 x i32> %0, i32 019 br label %220 21; <label>:2 ; preds = %entry22 %3 = phi i32 [ %1, %entry ]23 br label %424 25; <label>:4 ; preds = %226 %5 = phi i32 [ %3, %2 ]27 br label %get_local_id.exit28 29get_local_id.exit: ; preds = %430 %6 = phi i32 [ %5, %4 ]31 call void @llvm.dbg.value(metadata i32 %6, metadata !10, metadata !DIExpression()), !dbg !1232 %7 = call <4 x i32> @__amdil_get_global_id_int() nounwind, !dbg !1233 %8 = extractelement <4 x i32> %7, i32 0, !dbg !1234 br label %935 36; <label>:9 ; preds = %get_local_id.exit37 %10 = phi i32 [ %8, %get_local_id.exit ]38 br label %1139 40; <label>:11 ; preds = %941 %12 = phi i32 [ %10, %9 ]42 br label %get_global_id.exit43 44get_global_id.exit: ; preds = %1145 %13 = phi i32 [ %12, %11 ]46 call void @llvm.dbg.value(metadata i32 %13, metadata !13, metadata !DIExpression()), !dbg !1447 %14 = call <4 x i32> @__amdil_get_local_size_int() nounwind48 %15 = extractelement <4 x i32> %14, i32 049 br label %1650 51; <label>:16 ; preds = %get_global_id.exit52 %17 = phi i32 [ %15, %get_global_id.exit ]53 br label %1854 55; <label>:18 ; preds = %1656 %19 = phi i32 [ %17, %16 ]57 br label %get_local_size.exit58 59get_local_size.exit: ; preds = %1860 %20 = phi i32 [ %19, %18 ]61 call void @llvm.dbg.value(metadata i32 %20, metadata !15, metadata !DIExpression()), !dbg !1662 %tmp5 = add i32 %6, %13, !dbg !1763 %tmp7 = add i32 %tmp5, %20, !dbg !1764 store i32 %tmp7, ptr addrspace(1) %ip, align 4, !dbg !1765 br label %return, !dbg !1766 67return: ; preds = %get_local_size.exit68 ret void, !dbg !1869}70 71declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone72 73declare <4 x i32> @__amdil_get_local_size_int() nounwind74 75declare <4 x i32> @__amdil_get_local_id_int() nounwind76 77declare <4 x i32> @__amdil_get_global_id_int() nounwind78 79declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone80 81!llvm.dbg.cu = !{!2}82!llvm.module.flags = !{!22}83 84!0 = distinct !DISubprogram(name: "__OpenCL_nbt02_kernel", linkageName: "__OpenCL_nbt02_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2, file: !20, scope: !1, type: !3)85!1 = !DIFile(filename: "OCLlLwTXZ.cl", directory: "/tmp")86!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !21, retainedTypes: !21, imports: null)87!3 = !DISubroutineType(types: !4)88!4 = !{null, !5}89!5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align:64, scope: !2, baseType: !6)90!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint", file: !20, scope: !2, baseType: !7)91!7 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)92!8 = !DILocalVariable(name: "ip", line: 1, arg: 1, scope: !0, file: !1, type: !5)93!9 = !DILocation(line: 1, column: 32, scope: !0)94!10 = !DILocalVariable(name: "tid", line: 3, scope: !11, file: !1, type: !6)95!11 = distinct !DILexicalBlock(line: 2, column: 1, file: !1, scope: !0)96!12 = !DILocation(line: 5, column: 24, scope: !11)97!13 = !DILocalVariable(name: "gid", line: 3, scope: !11, file: !1, type: !6)98!14 = !DILocation(line: 6, column: 25, scope: !11)99!15 = !DILocalVariable(name: "lsz", line: 3, scope: !11, file: !1, type: !6)100!16 = !DILocation(line: 7, column: 26, scope: !11)101!17 = !DILocation(line: 9, column: 24, scope: !11)102!18 = !DILocation(line: 10, column: 1, scope: !0)103!20 = !DIFile(filename: "OCLlLwTXZ.cl", directory: "/tmp")104!21 = !{}105!22 = !{i32 1, !"Debug Info Version", i32 3}106