152 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -x mir -run-pass fixup-statepoint-caller-saved -verify-machineinstrs < %s | FileCheck %s3# RUN: llc -x mir -passes='fixup-statepoint-caller-saved' < %s | FileCheck %s4 5--- |6 ; ModuleID = 'undef.ll'7 source_filename = "test_undef.ll"8 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"9 target triple = "x86_64-unknown-linux-gnu"10 11 define void @test_undef(ptr addrspace(1) %arg1, ptr addrspace(1) %arg2, ptr addrspace(1) %arg3, ptr addrspace(1) %arg4) #0 gc "statepoint-example" {12 bb:13 %tmp1 = lshr i32 0, undef14 %tmp2 = load atomic i32, ptr addrspace(1) undef unordered, align 815 %tmp3 = load atomic i32, ptr addrspace(1) undef unordered, align 816 %tmp19 = inttoptr i64 undef to ptr addrspace(1)17 br label %bb718 19 bb7: ; preds = %bb20 %tmp4 = icmp slt i32 %tmp3, undef21 %tmp5 = select i1 %tmp4, i32 6, i32 undef22 %tmp6 = add i32 %tmp5, %tmp223 %tmp7 = call ptr addrspace(1) @wombat()24 %tmp20 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2, i32 5, ptr nonnull elementtype(void (ptr addrspace(1), i32, i32, ptr addrspace(1), i32)) @hoge, i32 5, i32 0, ptr addrspace(1) %tmp19, i32 %tmp2, i32 %tmp6, ptr addrspace(1) %tmp7, i32 0, i32 0, i32 0) [ "deopt"(ptr addrspace(1) %tmp19, ptr addrspace(1) %arg1, ptr addrspace(1) %arg3, ptr addrspace(1) %arg4, i32 %tmp2, i32 %tmp1, i32 %tmp5), "gc-live"(ptr addrspace(1) %tmp19, ptr addrspace(1) %arg2) ]25 %tmp21 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tmp20, i32 0, i32 0) ; (%tmp19, %tmp19)26 %tmp22 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tmp20, i32 1, i32 1) ; (%arg2, %arg2)27 ret void28 }29 30 declare void @hoge(ptr addrspace(1), i32, i32, ptr addrspace(1), i32) #031 32 declare ptr addrspace(1) @wombat() #033 34 ; Function Attrs: nounwind readonly35 declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32 immarg, i32 immarg) #136 37 declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...)38 39 attributes #0 = { "target-cpu"="broadwell" }40 attributes #1 = { nounwind readonly }41 42...43---44name: test_undef45alignment: 1646exposesReturnsTwice: false47legalized: false48regBankSelected: false49selected: false50failedISel: false51tracksRegLiveness: true52hasWinCFI: false53registers: []54liveins:55 - { reg: '$rdi', virtual-reg: '' }56 - { reg: '$rsi', virtual-reg: '' }57 - { reg: '$rdx', virtual-reg: '' }58 - { reg: '$rcx', virtual-reg: '' }59frameInfo:60 isFrameAddressTaken: false61 isReturnAddressTaken: false62 hasStackMap: false63 hasPatchPoint: false64 stackSize: 065 offsetAdjustment: 066 maxAlignment: 867 adjustsStack: false68 hasCalls: true69 stackProtector: ''70 maxCallFrameSize: 429496729571 cvBytesOfCalleeSavedRegisters: 072 hasOpaqueSPAdjustment: false73 hasVAStart: false74 hasMustTailInVarArgFunc: false75 localFrameSize: 076 savePoint: []77 restorePoint: []78fixedStack: []79stack:80 - { id: 0, name: '', type: default, offset: 0, size: 8, alignment: 8,81 stack-id: default, callee-saved-register: '', callee-saved-restored: true,82 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }83 - { id: 1, name: '', type: default, offset: 0, size: 8, alignment: 8,84 stack-id: default, callee-saved-register: '', callee-saved-restored: true,85 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }86 - { id: 2, name: '', type: default, offset: 0, size: 8, alignment: 8,87 stack-id: default, callee-saved-register: '', callee-saved-restored: true,88 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }89callSites: []90debugValueSubstitutions: []91constants: []92machineFunctionInfo: {}93body: |94 ; CHECK-LABEL: name: test_undef95 ; CHECK: bb.0.bb:96 ; CHECK: successors: %bb.1(0x80000000)97 ; CHECK: liveins: $rcx, $rdi, $rdx, $rsi98 ; CHECK: renamable $r15 = COPY $rcx99 ; CHECK: renamable $r12 = COPY $rdx100 ; CHECK: renamable $r14 = COPY $rsi101 ; CHECK: renamable $r13 = COPY $rdi102 ; CHECK: renamable $ebx = MOV32rm undef renamable $rax, 1, $noreg, 0, $noreg, implicit-def $rbx :: (load unordered (s32) from `ptr addrspace(1) undef`, align 8, addrspace 1)103 ; CHECK: bb.1.bb7:104 ; CHECK: liveins: $rbx, $r12, $r13, $r14, $r15105 ; CHECK: renamable $ebp = LEA64_32r renamable $rbx, 1, $noreg, 6, $noreg106 ; CHECK: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp107 ; CHECK: CALL64pcrel32 target-flags(x86-plt) @wombat, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax108 ; CHECK: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp109 ; CHECK: MOV64mr %stack.0, 1, $noreg, 0, $noreg, killed renamable $r13 :: (store (s64) into %stack.0)110 ; CHECK: MOV64mr %stack.1, 1, $noreg, 0, $noreg, killed renamable $r12 :: (store (s64) into %stack.1)111 ; CHECK: MOV64mr %stack.2, 1, $noreg, 0, $noreg, killed renamable $r15 :: (store (s64) into %stack.2)112 ; CHECK: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp113 ; CHECK: $esi = COPY renamable $ebx114 ; CHECK: $edx = COPY killed renamable $ebp115 ; CHECK: $rcx = COPY killed renamable $rax116 ; CHECK: $r8d = MOV32r0 implicit-def dead $eflags117 ; CHECK: MOV64mr %stack.3, 1, $noreg, 0, $noreg, killed $r14 :: (store (s64) into %stack.3)118 ; CHECK: STATEPOINT 2, 5, 5, undef renamable $rax, undef $rdi, $esi, $edx, $rcx, killed $r8d, 2, 0, 2, 0, 2, 7, undef renamable $rax, 1, 8, %stack.0, 0, 1, 8, %stack.1, 0, 1, 8, %stack.2, 0, renamable $ebx, undef renamable $eax, 2, 6, 2, 2, 1, 8, %stack.3, 0, undef renamable $rbx, 2, 0, 2, 2, 0, 0, 1, 1, csr_64, implicit-def $rsp, implicit-def $ssp, implicit killed $rbx :: (volatile load store (s64) on %stack.0), (volatile load store (s64) on %stack.1), (volatile load store (s64) on %stack.2), (load store (s64) on %stack.3)119 ; CHECK: $r14 = MOV64rm %stack.3, 1, $noreg, 0, $noreg :: (load (s64) from %stack.3)120 ; CHECK: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp121 ; CHECK: RET 0122 bb.0.bb:123 successors: %bb.1(0x80000000)124 liveins: $rcx, $rdi, $rdx, $rsi125 126 renamable $r15 = COPY $rcx127 renamable $r12 = COPY $rdx128 renamable $r14 = COPY $rsi129 renamable $r13 = COPY $rdi130 renamable $ebx = MOV32rm undef renamable $rax, 1, $noreg, 0, $noreg, implicit-def $rbx :: (load unordered (s32) from `ptr addrspace(1) undef`, align 8, addrspace 1)131 132 bb.1.bb7:133 liveins: $rbx, $r12, $r13, $r14, $r15134 135 renamable $ebp = LEA64_32r renamable $rbx, 1, $noreg, 6, $noreg136 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp137 CALL64pcrel32 target-flags(x86-plt) @wombat, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax138 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp139 MOV64mr %stack.0, 1, $noreg, 0, $noreg, killed renamable $r13 :: (store (s64) into %stack.0)140 MOV64mr %stack.1, 1, $noreg, 0, $noreg, killed renamable $r12 :: (store (s64) into %stack.1)141 MOV64mr %stack.2, 1, $noreg, 0, $noreg, killed renamable $r15 :: (store (s64) into %stack.2)142 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp143 $esi = COPY renamable $ebx144 $edx = COPY killed renamable $ebp145 $rcx = COPY killed renamable $rax146 $r8d = MOV32r0 implicit-def dead $eflags147 dead renamable $r14, dead renamable $rbx = STATEPOINT 2, 5, 5, undef renamable $rax, undef $rdi, $esi, $edx, $rcx, killed $r8d, 2, 0, 2, 0, 2, 7, undef renamable $rax, 1, 8, %stack.0, 0, 1, 8, %stack.1, 0, 1, 8, %stack.2, 0, renamable $ebx, undef renamable $eax, 2, 6, 2, 2, killed renamable $r14(tied-def 0), undef renamable $rbx(tied-def 1), 2, 0, 2, 2, 0, 0, 1, 1, csr_64, implicit-def $rsp, implicit-def $ssp, implicit killed $rbx :: (volatile load store (s64) on %stack.0), (volatile load store (s64) on %stack.1), (volatile load store (s64) on %stack.2)148 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp149 RET 0150 151...152