brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 8d506fa Raw
66 lines · plain
1# RUN: llc %s -o - -experimental-debug-variable-locations \2# RUN:    -run-pass=greedy,virtregrewriter | FileCheck %s3#4# This test is for stack spill folding -- the SETCC near the start of the MIR5# below show be morphed into an SETCCm by the register allocator, making it6# store to %stack.0. We should track this fact in the substitution table, by7# adding a substitution to the memory-operand operand number.8#9# This is a single operand spill -- there's a separate test for tied def ones.10#11# Ideally this test would be shorter; however, it needs to be sufficiently12# complex to force the register allocator to spill something, so there's a13# limit.14#15# CHECK:      debugValueSubstitutions:16# CHECK-NEXT:  - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 1000000, subreg: 0 }17# CHECK-LABEL: bb.0:18# CHECK: SETCCm %stack.0, {{.*}} debug-instr-number 219--- |20  target triple = "x86_64--"21  22  define void @beans() !dbg !7  {23    ret void24  }25   26  !llvm.dbg.cu = !{!0}27  !llvm.module.flags = !{!3, !4, !5}28  !llvm.ident = !{!6}29  30  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)31  !1 = !DIFile(filename: "test.c", directory: ".")32  !2 = !{}33  !3 = !{i32 7, !"Dwarf Version", i32 4}34  !4 = !{i32 2, !"Debug Info Version", i32 3}35  !5 = !{i32 1, !"wchar_size", i32 4}36  !6 = !{!"clang"}37  !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)38  !8 = !DISubroutineType(types: !9)39  !9 = !{!10, !11, !11}40  !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)41  !11 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)42  !12 = !DILocalVariable(name: "bar", arg: 1, scope: !7, file: !1, line: 3, type: !11)43  !13 = !DILocation(line: 0, scope: !7)44  !14 = !DILocalVariable(name: "baz", arg: 2, scope: !7, file: !1, line: 3, type: !11)45  !15 = distinct !DILexicalBlock(scope: !7, file: !1, line: 8, column: 7)46 47 48...49---50name: beans51tracksRegLiveness: True52debugInstrRef: true53body: |54  bb.0:55    liveins: $edi56    %7:gr32 = COPY $edi57    CMP32ri8 %7, 4, implicit-def $eflags58    %0:gr8 = SETCCr 4, implicit $eflags, debug-instr-number 159 60    ; clobber all registers to force a spill/reload61    INLINEASM &nop, 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def dead early-clobber $rax, 12 /* clobber */, implicit-def dead early-clobber $rbx, 12 /* clobber */, implicit-def dead early-clobber $rcx, 12 /* clobber */, implicit-def dead early-clobber $rdx, 12 /* clobber */, implicit-def dead early-clobber $rsi, 12 /* clobber */, implicit-def dead early-clobber $rdi, 12 /* clobber */, implicit-def dead early-clobber $rbp, 12 /* clobber */, implicit-def dead early-clobber $r8, 12 /* clobber */, implicit-def dead early-clobber $r9, 12 /* clobber */, implicit-def dead early-clobber $r10, 12 /* clobber */, implicit-def dead early-clobber $r11, 12 /* clobber */, implicit-def dead early-clobber $r12, 12 /* clobber */, implicit-def dead early-clobber $r13, 12 /* clobber */, implicit-def dead early-clobber $r14, 12 /* clobber */, implicit-def dead early-clobber $r1562 63    $al = COPY %064    RET 0, $al65...66