brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 6357c5a Raw
78 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.2'35# CHECK:      restorePoint:36# CHECK-NEXT:   - point:           '%bb.2'37# CHECK: stack38frameInfo:39  maxAlignment:  440  hasCalls:      true41  savePoint:42   - point:           '%bb.2'43  restorePoint:44    - point:           '%bb.2'45stack:46  - { id: 0, name: tmp, offset: 0, size: 4, alignment: 4 }47body: |48  bb.0:49    successors: %bb.2, %bb.150    liveins: $edi, $esi51 52    $eax = COPY $edi53    CMP32rr $eax, killed $esi, implicit-def $eflags54    JCC_1 %bb.2, 12, implicit killed $eflags55 56  bb.1:57    successors: %bb.358    liveins: $eax59 60    JMP_1 %bb.361 62  bb.2.true:63    successors: %bb.364    liveins: $eax65 66    MOV32mr %stack.0.tmp, 1, _, 0, _, killed $eax67    ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eflags, implicit $rsp, implicit $ssp68    $rsi = LEA64r %stack.0.tmp, 1, _, 0, _69    $edi = MOV32r0 implicit-def dead $eflags70    CALL64pcrel32 @doSomething, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $rsi, implicit-def $rsp, implicit-def $ssp, implicit-def $eax71    ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eflags, implicit $rsp, implicit $ssp72 73  bb.3.false:74    liveins: $eax75 76    RET64 $eax77...78