brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · f0a19d8 Raw
97 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass none -o - %s | FileCheck %s2# This test ensures that the MIR parser parses callee saved information in the3# stack objects correctly.4 5--- |6 7  define i32 @compute(i32 %a) {8  body:9    ret i32 %a10  }11 12  define i32 @func(i32 %a) {13  entry:14    %b = alloca i3215    store i32 %a, ptr %b16    br label %check17 18  check:19    %comp = icmp sle i32 %a, 1020    br i1 %comp, label %loop, label %exit21 22  loop:23    %c = load i32, ptr %b24    %d = call i32 @compute(i32 %c)25    %e = sub i32 %d, 126    store i32 %e, ptr %b27    br label %check28 29  exit:30    ret i32 031  }32 33...34---35name:            compute36tracksRegLiveness: true37body: |38  bb.0.body:39    liveins: $edi40 41    $eax = COPY killed $edi42    RET64 killed $eax43...44---45name:            func46tracksRegLiveness: true47frameInfo:48  stackSize:       2449  maxAlignment:    450  adjustsStack:    true51  hasCalls:        true52# CHECK: fixedStack:53# CHECK: callee-saved-register: '$rbx', callee-saved-restored: true54fixedStack:55  - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$rbx' }56# CHECK: stack:57# CHECK-NEXT: - { id: 058# CHECK: callee-saved-register: '$edi', callee-saved-restored: false59stack:60  - { id: 0, name: b, offset: -20, size: 4, alignment: 4 }61  - { id: 1, offset: -24, size: 4, alignment: 4, callee-saved-register: '$edi',62      callee-saved-restored: false }63body: |64  bb.0.entry:65    successors: %bb.1.check66    liveins: $edi, $rbx67 68    frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp69    $rsp = frame-setup SUB64ri8 $rsp, 16, implicit-def dead $eflags70    $ebx = COPY $edi71    MOV32mr $rsp, 1, _, 12, _, $ebx72 73  bb.1.check:74    successors: %bb.2.loop, %bb.3.exit75    liveins: $ebx76 77    CMP32ri8 $ebx, 10, implicit-def $eflags78    JCC_1 %bb.3.exit, 15, implicit killed $eflags79    JMP_1 %bb.2.loop80 81  bb.2.loop:82    successors: %bb.1.check83    liveins: $ebx84 85    $edi = MOV32rm $rsp, 1, _, 12, _86    CALL64pcrel32 @compute, csr_64, implicit $rsp, implicit $edi, implicit-def $rsp, implicit-def $eax87    $eax = DEC32r killed $eax, implicit-def dead $eflags88    MOV32mr $rsp, 1, _, 12, _, killed $eax89    JMP_1 %bb.1.check90 91  bb.3.exit:92    $eax = MOV32r0 implicit-def dead $eflags93    $rsp = ADD64ri8 $rsp, 16, implicit-def dead $eflags94    $rbx = POP64r implicit-def $rsp, implicit $rsp95    RET64 $eax96...97