brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · be2c8cb Raw
62 lines · plain
1; RUN: opt --passes=loop-rotate -o - -S %s | FileCheck %s --implicit-check-not=dbg_value2;3;; Test some fine-grained behaviour of loop-rotate's de-duplication of4;; dbg.values. The intrinsic on the first branch should be seen and5;; prevent the rotation of the dbg.value for "sink" into the entry block.6;; However the other dbg.value, for "source", should not be seen, and we'll7;; get a duplicate.8;9target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"10target triple = "x86_64-unknown-linux-gnu"11 12 13; CHECK-LABEL: define void @_ZNK4llvm5APInt4sextEj(ptr14; CHECK-LABEL: entry:15; CHECK:       #dbg_value(i32 0, ![[SRC:[0-9]+]],16; CHECK-NEXT:  load17; CHECK-NEXT:  #dbg_value(i32 0, ![[SINK:[0-9]+]],18; CHECK-NEXT:  #dbg_value(i32 0, ![[SRC]],19; CHECK-LABEL: for.body:20; CHECK:       #dbg_value(i32 0, ![[SINK]],21; CHECK-NEXT:  #dbg_value(i32 0, ![[SRC]],22 23declare void @llvm.dbg.value(metadata, metadata, metadata)24 25define void @_ZNK4llvm5APInt4sextEj(ptr %agg.result) !dbg !5 {26entry:27  tail call void @llvm.dbg.value(metadata i32 0, metadata !4, metadata !DIExpression()), !dbg !1028  %.pre = load i32, ptr %agg.result, align 829  tail call void @llvm.dbg.value(metadata i32 0, metadata !11, metadata !DIExpression()), !dbg !1030  br label %for.cond31 32for.cond:                                         ; preds = %for.body, %entry33  %i.0 = phi i32 [ 0, %entry ], [ 1, %for.body ]34  tail call void @llvm.dbg.value(metadata i32 0, metadata !11, metadata !DIExpression()), !dbg !1035  tail call void @llvm.dbg.value(metadata i32 0, metadata !4, metadata !DIExpression()), !dbg !1036  %cmp12.not = icmp eq i32 %i.0, %.pre, !dbg !1037  br i1 %cmp12.not, label %for.end, label %for.body38 39for.body:                                         ; preds = %for.cond40  store i64 0, ptr %agg.result, align 841  br label %for.cond42 43for.end:                                          ; preds = %for.cond44  ret void45}46 47!llvm.dbg.cu = !{!0}48!llvm.module.flags = !{!3}49 50!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, splitDebugInlining: false, nameTableKind: None)51!1 = !DIFile(filename: "foo", directory: "bar")52!2 = !{}53!3 = !{i32 2, !"Debug Info Version", i32 3}54!4 = !DILocalVariable(name: "source", scope: !5, file: !6, line: 170, type: !8)55!5 = distinct !DISubprogram(name: "ConvertUTF16toUTF32", scope: !6, file: !6, line: 166, type: !7, scopeLine: 168, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)56!6 = !DIFile(filename: "fooo", directory: ".")57!7 = !DISubroutineType(types: !2)58!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64)59!9 = !DIBasicType(name: "unsigned short", size: 16, encoding: DW_ATE_unsigned)60!10 = !DILocation(line: 0, scope: !5)61!11 = !DILocalVariable(name: "sink", scope: !5, file: !6, line: 170, type: !8)62