|
| 1 | +; RUN: opt %s -sroa -early-cse -S | FileCheck %s |
| 2 | +; CHECK: DIExpression(DW_OP_constu, 9223372036854775808, DW_OP_minus, DW_OP_stack_value) |
| 3 | +; Created from the following C input (and then delta-reduced the IR): |
| 4 | +; |
| 5 | +; extern unsigned long long use(unsigned long long); |
| 6 | +; void f(unsigned long long x) { |
| 7 | +; for (; x > 0; x --) { |
| 8 | +; unsigned long long y = x + 0x8000000000000000; |
| 9 | +; use(x); |
| 10 | +; } |
| 11 | +; } |
| 12 | + |
| 13 | +define void @f(i64 noundef %x) #0 !dbg !9 { |
| 14 | +entry: |
| 15 | + %x.addr = alloca i64, align 8 |
| 16 | + %y = alloca i64, align 8 |
| 17 | + br label %for.cond |
| 18 | +for.cond: ; preds = %for.inc, %entry |
| 19 | + %0 = load i64, i64* %x.addr, align 8 |
| 20 | + %1 = bitcast i64* %y to i8* |
| 21 | + call void @llvm.dbg.declare(metadata i64* %y, metadata !15, metadata !DIExpression()) |
| 22 | +, !dbg !29 |
| 23 | + %2 = load i64, i64* %x.addr, align 8 |
| 24 | + %add = add i64 %2, -9223372036854775808 |
| 25 | + store i64 %add, i64* %y, align 8 |
| 26 | + br label %for.cond |
| 27 | +} |
| 28 | +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 29 | + |
| 30 | +!llvm.module.flags = !{!3,!7} |
| 31 | + |
| 32 | +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None, sysroot: "/") |
| 33 | +!1 = !DIFile(filename: "t.c", directory: "/") |
| 34 | +!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 35 | +!7 = !{i32 7, !"frame-pointer", i32 2} |
| 36 | +!9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !10, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13) |
| 37 | +!10 = !DISubroutineType(types: !11) |
| 38 | +!11 = !{null, !12} |
| 39 | +!12 = !DIBasicType(name: "unsigned long long", size: 64, encoding: DW_ATE_unsigned) |
| 40 | +!13 = !{} |
| 41 | +!15 = !DILocalVariable(name: "y", scope: !16, file: !1, line: 4, type: !12) |
| 42 | +!16 = distinct !DILexicalBlock(scope: !17, file: !1, line: 3, column: 23) |
| 43 | +!17 = distinct !DILexicalBlock(scope: !18, file: !1, line: 3, column: 3) |
| 44 | +!18 = distinct !DILexicalBlock(scope: !9, file: !1, line: 3, column: 3) |
| 45 | +!29 = !DILocation(line: 4, column: 24, scope: !16) |
0 commit comments