105 lines · plain
1# RUN: llc %s -run-pass=postra-machine-sink -o - | FileCheck %s2# RUN: llc %s -passes='postra-machine-sink' -o - | FileCheck %s3--- |4 ; Module stripped of everything, MIR below is what's interesting5 ; ModuleID = '<stdin>'6 source_filename = "justacall.cpp"7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"8 target triple = "x86_64-unknown-linux-gnu"9 10 ; Function Attrs: noinline norecurse nounwind uwtable11 define dso_local i32 @main(i32 %argc, ptr nocapture readnone %argv) local_unnamed_addr #0 {12 entry:13 br label %if.end14 if.end:15 br label %return16 return:17 ret i32 018 }19 20 !0 = !{!"dummy metadata"}21 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)22 !3 = !DIFile(filename: "justacall.cpp", directory: "/tmp")23 !4 = !{}24 !5 = !{!0}25 !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)26 !14 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 7, type: !15, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !20)27 !15 = !DISubroutineType(types: !16)28 !16 = !{!7, !7}29 !20 = !{!21}30 !21 = !DILocalVariable(name: "argc", arg: 1, scope: !14, file: !3, line: 7, type: !7)31 32...33---34name: main35alignment: 1636exposesReturnsTwice: false37legalized: false38regBankSelected: false39selected: false40failedISel: false41tracksRegLiveness: true42hasWinCFI: false43registers:44liveins:45 - { reg: '$edi', virtual-reg: '' }46frameInfo:47 isFrameAddressTaken: false48 isReturnAddressTaken: false49 hasStackMap: false50 hasPatchPoint: false51 stackSize: 052 offsetAdjustment: 053 maxAlignment: 054 adjustsStack: false55 hasCalls: true56 stackProtector: ''57 maxCallFrameSize: 429496729558 cvBytesOfCalleeSavedRegisters: 059 hasOpaqueSPAdjustment: false60 hasVAStart: false61 hasMustTailInVarArgFunc: false62 localFrameSize: 063 savePoint: []64 restorePoint: []65fixedStack:66stack:67constants:68body: |69 bb.0.entry:70 successors: %bb.2(0x40000000), %bb.1(0x40000000)71 liveins: $edi72 73 ; Test that the DBG_VALUE on ebx below is sunk with the def of ebx, despite74 ; not being adjacent to the def, see PR3895275 76 DBG_VALUE $edi, $noreg77 renamable $ebx = COPY $edi78 renamable $eax = MOV32r0 implicit-def dead $eflags79 DBG_VALUE $ebx, $noreg80 CMP32ri $edi, 255, implicit-def $eflags81 JCC_1 %bb.2, 15, implicit killed $eflags82 JMP_1 %bb.183 84 bb.1.if.end:85 ; CHECK-LABEL: bb.1.if.end86 successors: %bb.2(0x80000000)87 liveins: $ebx88 89 ; CHECK: $ebx = COPY $edi90 ; CHECK-NEXT: DBG_VALUE $ebx91 renamable $rdx = MOVSX64rr32 renamable $ebx92 renamable $rdx = nsw SHL64ri killed renamable $rdx, 2, implicit-def dead $eflags93 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp94 $rdi = MOV32ri64 095 $esi = MOV32r0 implicit-def dead $eflags96 CALL64pcrel32 &memset, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit killed $esi, implicit $rdx, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax97 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp98 99 bb.2.return:100 liveins: $eax101 102 RET 0, $eax103 104...105