86 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass none -o - %s | FileCheck %s2# This test ensures that the MIR parser parses the save and restore points in3# the machine frame info correctly.4 5--- |6 7 define i32 @foo(i32 %a, i32 %b) {8 entry:9 %tmp = alloca i32, align 410 %tmp2 = icmp slt i32 %a, %b11 br i1 %tmp2, label %true, label %false12 13 true:14 store i32 %a, ptr %tmp, align 415 %tmp4 = call i32 @doSomething(i32 0, ptr %tmp)16 br label %false17 18 false:19 %tmp.0 = phi i32 [ %tmp4, %true ], [ %a, %entry ]20 ret i32 %tmp.021 }22 23 declare i32 @doSomething(i32, ptr)24 25...26---27name: foo28tracksRegLiveness: true29liveins:30 - { reg: '$edi' }31 - { reg: '$esi' }32# CHECK: frameInfo:33# CHECK: savePoint:34# CHECK-NEXT: - point: '%bb.1'35# CHECK-NEXT: registers: []36# CHECK-NEXT: - point: '%bb.2'37# CHECK-NEXT: registers: []38# CHECK: restorePoint:39# CHECK-NEXT: - point: '%bb.2'40# CHECK-NEXT: registers: []41# CHECK-NEXT: - point: '%bb.3'42# CHECK-NEXT: registers: []43# CHECK: stack44frameInfo:45 maxAlignment: 446 hasCalls: true47 savePoint:48 - point: '%bb.1'49 - point: '%bb.2'50 restorePoint: 51 - point: '%bb.2'52 - point: '%bb.3'53stack:54 - { id: 0, name: tmp, offset: 0, size: 4, alignment: 4 }55body: |56 bb.0:57 successors: %bb.2, %bb.158 liveins: $edi, $esi59 60 $eax = COPY $edi61 CMP32rr $eax, killed $esi, implicit-def $eflags62 JCC_1 %bb.2, 12, implicit killed $eflags63 64 bb.1:65 successors: %bb.366 liveins: $eax67 68 JMP_1 %bb.369 70 bb.2.true:71 successors: %bb.372 liveins: $eax73 74 MOV32mr %stack.0.tmp, 1, _, 0, _, killed $eax75 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eflags, implicit $rsp, implicit $ssp76 $rsi = LEA64r %stack.0.tmp, 1, _, 0, _77 $edi = MOV32r0 implicit-def dead $eflags78 CALL64pcrel32 @doSomething, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $rsi, implicit-def $rsp, implicit-def $ssp, implicit-def $eax79 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eflags, implicit $rsp, implicit $ssp80 81 bb.3.false:82 liveins: $eax83 84 RET64 $eax85...86