55 lines · plain
1; RUN: opt -S -loop-reduce %s | FileCheck %s2 3;; Ensure that scev-based salvaging in LSR does not select an IV containing4;; an 'undef' element.5 6target triple = "x86_64-unknown-linux-gnu"7 8define i16 @n(i1 %c1) !dbg !8 {9entry:10 br i1 %c1, label %m, label %for.body11 12for.body: ; preds = %for.body, %entry13 %iv = phi i16 [ %ivdec, %for.body ], [ 14, %entry ]14 %ivdec = sub i16 %iv, 115 call void @llvm.dbg.value(metadata i16 %iv, metadata !21, metadata !DIExpression()), !dbg !1916 br label %for.body17 18m: ; preds = %m, %entry19 %0 = phi i16 [ 3, %m ], [ 6, %entry ]20 %gg = add i16 %0, 2321 ; CHECK: #dbg_value(i16 poison, !{{[0-9]+}}, !DIExpression(),22 call void @llvm.dbg.value(metadata i16 %0, metadata !14, metadata !DIExpression()), !dbg !1923 br label %m24}25 26; Function Attrs: nofree nosync nounwind readnone speculatable willreturn27declare void @llvm.dbg.value(metadata, metadata, metadata)28 29!llvm.dbg.cu = !{!0}30!llvm.module.flags = !{!3, !4, !5, !6}31!llvm.ident = !{!7}32 33!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !2, splitDebugInlining: false, nameTableKind: None)34!1 = !DIFile(filename: "reduced.c", directory: "/")35!2 = !{}36!3 = !{i32 7, !"Dwarf Version", i32 4}37!4 = !{i32 2, !"Debug Info Version", i32 3}38!5 = !{i32 1, !"wchar_size", i32 1}39!6 = !{i32 7, !"frame-pointer", i32 2}40!7 = !{!"clang version 14.0.0"}41!8 = distinct !DISubprogram(name: "n", scope: !1, file: !1, line: 18, type: !9, scopeLine: 18, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)42!9 = !DISubroutineType(types: !10)43!10 = !{!11}44!11 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)45!12 = !{!13}46!13 = !DILabel(scope: !8, name: "m", file: !1, line: 22)47!14 = !DILocalVariable(name: "k", arg: 2, scope: !15, file: !1, line: 9, type: !11)48!15 = distinct !DISubprogram(name: "i", scope: !1, file: !1, line: 9, type: !16, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !18)49!16 = !DISubroutineType(types: !17)50!17 = !{!11, !11, !11}51!18 = !{!14}52!19 = !DILocation(line: 0, scope: !15, inlinedAt: !20)53!20 = distinct !DILocation(line: 23, scope: !8)54!21 = !DILocalVariable(name: "x", arg: 2, scope: !15, file: !1, line: 1, type: !11)55