1; RUN: opt < %s -loop-reduce -S | FileCheck %s 2; RUN: opt --try-experimental-debuginfo-iterators < %s -loop-reduce -S | FileCheck %s 3; 4; Test that LSR avoids crashing on very large integer inputs. It should 5; discard the variable location by creating an undef dbg.value. 6; 7; CHECK: #dbg_value(i128 poison, 8 9source_filename = "<stdin>" 10target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 11target triple = "x86_64-unknown-linux-gnu" 12 13define dso_local void @qux() local_unnamed_addr !dbg !10 { 14entry: 15 br label %for.body, !dbg !17 16 17for.body: ; preds = %for.body.for.body_crit_edge, %entry 18 %0 = phi i128 [ 0, %entry ], [ %.pre8, %for.body.for.body_crit_edge ], !dbg !19 19 %add6.i.i = add i128 %0, 18446744073709551615, !dbg !35 20 call void @llvm.dbg.value(metadata i128 %add6.i.i, metadata !25, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 128)), !dbg !36 21 br label %for.body.for.body_crit_edge 22 23for.body.for.body_crit_edge: ; preds = %for.body 24 %.pre8 = load i128, ptr undef, align 16, !dbg !19, !tbaa !37 25 br label %for.body, !dbg !17 26} 27 28; Function Attrs: nofree nosync nounwind readnone speculatable willreturn 29declare void @llvm.dbg.value(metadata, metadata, metadata) 30 31!llvm.dbg.cu = !{!0} 32!llvm.module.flags = !{!7, !8, !9} 33 34!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !2, splitDebugInlining: false, nameTableKind: None) 35!1 = !DIFile(filename: "/tmp/beans.c", directory: "/tmp") 36!2 = !{} 37!3 = !{!4} 38!4 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint64_t", file: !5, line: 1, baseType: !6) 39!5 = !DIFile(filename: "/tmp/beans.c", directory: "") 40!6 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned) 41!7 = !{i32 7, !"Dwarf Version", i32 4} 42!8 = !{i32 2, !"Debug Info Version", i32 3} 43!9 = !{i32 1, !"wchar_size", i32 4} 44!10 = distinct !DISubprogram(name: "qux", scope: !5, file: !5, line: 27, type: !11, scopeLine: 27, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) 45!11 = !DISubroutineType(types: !12) 46!12 = !{null, !13, !13} 47!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64) 48!14 = !DIDerivedType(tag: DW_TAG_typedef, name: "croix", file: !5, line: 2, baseType: !15) 49!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "__uint128_t", file: !1, baseType: !16) 50!16 = !DIBasicType(name: "unsigned __int128", size: 128, encoding: DW_ATE_unsigned) 51!17 = !DILocation(line: 30, column: 3, scope: !18) 52!18 = distinct !DILexicalBlock(scope: !10, file: !5, line: 30, column: 3) 53!19 = !DILocation(line: 12, column: 25, scope: !20, inlinedAt: !30) 54!20 = distinct !DISubprogram(name: "bar", scope: !5, file: !5, line: 8, type: !21, scopeLine: 8, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !24) 55!21 = !DISubroutineType(types: !22) 56!22 = !{null, !23, !13} 57!23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64) 58!24 = !{!25} 59!25 = !DILocalVariable(name: "tmp", scope: !20, file: !5, line: 9, type: !26) 60!26 = !DIDerivedType(tag: DW_TAG_typedef, name: "xyzzy", file: !5, line: 3, baseType: !27) 61!27 = !DICompositeType(tag: DW_TAG_array_type, baseType: !14, size: 512, elements: !28) 62!28 = !{!29} 63!29 = !DISubrange(count: 4) 64!30 = distinct !DILocation(line: 23, column: 3, scope: !31, inlinedAt: !32) 65!31 = distinct !DISubprogram(name: "baz", scope: !5, file: !5, line: 21, type: !11, scopeLine: 21, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) 66!32 = distinct !DILocation(line: 31, column: 5, scope: !33) 67!33 = distinct !DILexicalBlock(scope: !34, file: !5, line: 30, column: 31) 68!34 = distinct !DILexicalBlock(scope: !18, file: !5, line: 30, column: 3) 69!35 = !DILocation(line: 12, column: 23, scope: !20, inlinedAt: !30) 70!36 = !DILocation(line: 0, scope: !20, inlinedAt: !30) 71!37 = !{!38, !38, i64 0} 72!38 = !{!"__int128", !39, i64 0} 73!39 = !{!"omnipotent char", !40, i64 0} 74!40 = !{!"Simple C/C++ TBAA"} 75