brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 59b6ef5 Raw
71 lines · plain
1; RUN: opt -passes=jump-threading -S %s -o - | FileCheck %s2define void @prepare_next_shadow() !dbg !7 {3entry:4  br label %for.cond, !dbg !95 6for.cond:                                         ; preds = %for.inc, %entry7  br label %shadow_to_ptr.exit, !dbg !108 9shadow_to_ptr.exit:                               ; preds = %for.cond10  %shr.i = lshr i64 0, 12, !dbg !1111  %cmp.i = icmp ult i64 %shr.i, undef, !dbg !1212  br i1 %cmp.i, label %cleanup.i, label %if.end.i60, !dbg !1313 14if.end.i60:                                       ; preds = %shadow_to_ptr.exit15  %sub.i = sub i64 %shr.i, undef, !dbg !1416  %cmp3.i = icmp ugt i64 %sub.i, 32763, !dbg !1517  %conv7.i = trunc i64 %sub.i to i32, !dbg !1618  %spec.select.i = select i1 %cmp3.i, i32 -1, i32 %conv7.i, !dbg !1719; Jump threading is going to fold the select in to the branch. Ensure debug20; info is not lost, and is merged from the select and the branch.21; CHECK-NOT: br i1 %cmp3.i, label %for.inc, label %if.end2222; CHECK: br i1 %cmp3.i, label %for.inc, label %if.end22, !dbg [[DBG:![0-9]+]]23; CHECK: [[DBG]] = !DILocation(line: 9, column: 1, scope: !{{.*}})24 25  br label %ptr_to_shadow.exit, !dbg !1726 27cleanup.i:                                        ; preds = %shadow_to_ptr.exit28  br label %ptr_to_shadow.exit, !dbg !1929 30ptr_to_shadow.exit:                               ; preds = %cleanup.i, %if.end.i6031  %call1861 = phi i32 [ %spec.select.i, %if.end.i60 ], [ -1, %cleanup.i ], !dbg !2032  %cmp19 = icmp slt i32 %call1861, 0, !dbg !2133  br i1 %cmp19, label %for.inc, label %if.end22, !dbg !2234 35if.end22:                                         ; preds = %ptr_to_shadow.exit36  unreachable, !dbg !2337 38for.inc:                                          ; preds = %ptr_to_shadow.exit39  br label %for.cond, !dbg !2440}41 42!llvm.ident = !{!0}43!llvm.dbg.cu = !{!1}44!llvm.debugify = !{!4, !5}45!llvm.module.flags = !{!6}46 47!0 = !{!""}48!1 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !3)49!2 = !DIFile(filename: "jump_threading.ll", directory: "/")50!3 = !{}51!4 = !{i32 16}52!5 = !{i32 0}53!6 = !{i32 2, !"Debug Info Version", i32 3}54!7 = distinct !DISubprogram(name: "prepare_next_shadow", linkageName: "prepare_next_shadow", scope: null, file: !2, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1, retainedNodes: !3)55!8 = !DISubroutineType(types: !3)56!9 = !DILocation(line: 1, column: 1, scope: !7)57!10 = !DILocation(line: 2, column: 1, scope: !7)58!11 = !DILocation(line: 3, column: 1, scope: !7)59!12 = !DILocation(line: 4, column: 1, scope: !7)60!13 = !DILocation(line: 5, column: 1, scope: !7)61!14 = !DILocation(line: 6, column: 1, scope: !7)62!15 = !DILocation(line: 7, column: 1, scope: !7)63!16 = !DILocation(line: 8, column: 1, scope: !7)64!17 = !DILocation(line: 9, column: 1, scope: !7)65!19 = !DILocation(line: 11, column: 1, scope: !7)66!20 = !DILocation(line: 12, column: 1, scope: !7)67!21 = !DILocation(line: 13, column: 1, scope: !7)68!22 = !DILocation(line: 14, column: 1, scope: !7)69!23 = !DILocation(line: 15, column: 1, scope: !7)70!24 = !DILocation(line: 16, column: 1, scope: !7)71