138 lines · plain
1# We do not support call site parameters when the machine instructions loading a value2# into the forwarding register has a memory operand and multiple defs.3# The generated code was modified a bit in order to have the scenario.4#5# RUN: llc -emit-call-site-info -debug-entry-values -start-after=machineverifier -filetype=obj %s -o - \6# RUN: | llvm-dwarfdump - | FileCheck %s --implicit-check-not=DW_TAG_GNU_call_site_parameter7#8# Command: clang -g -O2 -Xclang -femit-debug-entry-values test.c9# -mllvm -stop-before=machineverifier -o test.mir -c10# extern void callee(int);11# extern int y;12#13# #define FORCE_SPILL() \14# asm volatile("" \15# : \16# : \17# : "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "r8", "r9", \18# "r10", "r11", "r12", "r13", "r14", "r15")19#20# __attribute__((disable_tail_calls)) void caller(int x) {21# FORCE_SPILL();22# x = x % y;23# callee(x);24# }25#26--- |27 ; ModuleID = 'test.c'28 source_filename = "test.c"29 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"30 target triple = "x86_64-unknown-linux-gnu"31 32 @y = external dso_local local_unnamed_addr global i32, align 433 34 ; Function Attrs: nounwind uwtable35 define dso_local void @caller(i32 %x) local_unnamed_addr !dbg !12 {36 entry:37 call void @llvm.dbg.value(metadata i32 %x, metadata !14, metadata !DIExpression()), !dbg !1538 call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !16, !srcloc !1739 %0 = load i32, ptr @y, align 4, !dbg !1840 %rem = srem i32 %x, %0, !dbg !1841 call void @llvm.dbg.value(metadata i32 %rem, metadata !14, metadata !DIExpression()), !dbg !1542 call void @callee(i32 %rem), !dbg !1843 ret void, !dbg !1844 }45 46 declare !dbg !4 dso_local void @callee(i32) local_unnamed_addr47 48 ; Function Attrs: nounwind readnone speculatable willreturn49 declare void @llvm.dbg.value(metadata, metadata, metadata)50 51 !llvm.dbg.cu = !{!0}52 !llvm.module.flags = !{!8, !9, !10}53 !llvm.ident = !{!11}54 55 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, splitDebugInlining: false, nameTableKind: None)56 !1 = !DIFile(filename: "test.c", directory: "/")57 !2 = !{}58 !3 = !{!4}59 !4 = !DISubprogram(name: "callee", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)60 !5 = !DISubroutineType(types: !6)61 !6 = !{null, !7}62 !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)63 !8 = !{i32 7, !"Dwarf Version", i32 4}64 !9 = !{i32 2, !"Debug Info Version", i32 3}65 !10 = !{i32 1, !"wchar_size", i32 4}66 !11 = !{!"clang version 11.0.0"}67 !12 = distinct !DISubprogram(name: "caller", scope: !1, file: !1, line: 11, type: !5, scopeLine: 11, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13)68 !13 = !{!14}69 !14 = !DILocalVariable(name: "x", arg: 1, scope: !12, file: !1, line: 11, type: !7)70 !15 = !DILocation(line: 0, scope: !12)71 !16 = !DILocation(line: 12, column: 4, scope: !12)72 !17 = !{i32 -2147471651}73 !18 = !DILocation(line: 13, column: 12, scope: !12)74 75...76---77name: caller78alignment: 1679stack:80 - { id: 0, name: '', type: spill-slot, offset: -60, size: 4, alignment: 4, 81 stack-id: default, callee-saved-register: '', callee-saved-restored: true, 82 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }83callSites:84 - { bb: 0, offset: 30, fwdArgRegs: 85 - { arg: 0, reg: '$edi' } }86body: |87 bb.0.entry:88 liveins: $edi, $rbp, $r15, $r14, $r13, $r12, $rbx89 90 DBG_VALUE $edi, $noreg, !14, !DIExpression(), debug-location !1591 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp92 CFI_INSTRUCTION def_cfa_offset 1693 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp94 CFI_INSTRUCTION def_cfa_offset 2495 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp96 CFI_INSTRUCTION def_cfa_offset 3297 frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp98 CFI_INSTRUCTION def_cfa_offset 4099 frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp100 CFI_INSTRUCTION def_cfa_offset 48101 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp102 CFI_INSTRUCTION def_cfa_offset 56103 frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp104 CFI_INSTRUCTION def_cfa_offset 64105 CFI_INSTRUCTION offset $rbx, -56106 CFI_INSTRUCTION offset $r12, -48107 CFI_INSTRUCTION offset $r13, -40108 CFI_INSTRUCTION offset $r14, -32109 CFI_INSTRUCTION offset $r15, -24110 CFI_INSTRUCTION offset $rbp, -16111 MOV32mr $rsp, 1, $noreg, 4, $noreg, $edi :: (store (s32) into %stack.0)112 DBG_VALUE $rsp, 0, !14, !DIExpression(DW_OP_plus_uconst, 4), debug-location !15113 INLINEASM &"", 1, 12, implicit-def dead early-clobber $rax, 12, implicit-def dead early-clobber $rbx, 12, implicit-def dead early-clobber $rcx, 12, implicit-def dead early-clobber $rdx, 12, implicit-def dead early-clobber $rsi, 12, implicit-def dead early-clobber $rdi, 12, implicit-def dead early-clobber $rbp, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $df, 12, implicit-def early-clobber $fpsw, 12, implicit-def dead early-clobber $eflags, !17, debug-location !16114 $eax = MOV32rm $rsp, 1, $noreg, 4, $noreg :: (load (s32) from %stack.0)115 DBG_VALUE $eax, $noreg, !14, !DIExpression(), debug-location !15116 CDQ implicit-def $eax, implicit-def $edx, implicit $eax, debug-location !18117 DIV64m $rsp, 1, $noreg, 24, $noreg, implicit-def dead $rax, implicit-def $rdx, implicit-def dead $eflags, implicit $rax, implicit $rdx, debug-location !18 :: (load (s64) from %stack.0)118 $edi = MOV32rr $edx, debug-location !18119 DBG_VALUE $edi, $noreg, !14, !DIExpression(), debug-location !15120 CALL64pcrel32 @callee, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit-def $rsp, implicit-def $ssp, debug-location !18121 $rsp = frame-destroy ADD64ri8 $rsp, 8, implicit-def dead $eflags, debug-location !18122 CFI_INSTRUCTION def_cfa_offset 56, debug-location !18123 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !18124 CFI_INSTRUCTION def_cfa_offset 48, debug-location !18125 $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !18126 CFI_INSTRUCTION def_cfa_offset 40, debug-location !18127 $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !18128 CFI_INSTRUCTION def_cfa_offset 32, debug-location !18129 $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !18130 CFI_INSTRUCTION def_cfa_offset 24, debug-location !18131 $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !18132 CFI_INSTRUCTION def_cfa_offset 16, debug-location !18133 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !18134 CFI_INSTRUCTION def_cfa_offset 8, debug-location !18135 RET64 debug-location !18136 137...138