diff options
| author | Alex Lorenz <arphaman@gmail.com> | 2015-07-29 21:09:09 +0000 |
|---|---|---|
| committer | Alex Lorenz <arphaman@gmail.com> | 2015-07-29 21:09:09 +0000 |
| commit | a6f9a37d92bbecaec799e02f84d6bf2cb866e91b (patch) | |
| tree | 3fa1f0939fa8b91a98f9f014bccbf7aacca64f02 /llvm/test | |
| parent | ff16b9ac90dc92ebb2b3097707148930abeca2f8 (diff) | |
| download | bcm5719-llvm-a6f9a37d92bbecaec799e02f84d6bf2cb866e91b.tar.gz bcm5719-llvm-a6f9a37d92bbecaec799e02f84d6bf2cb866e91b.zip | |
MIR Serialization: Serialize the frame info's save and restore points.
This commit serializes the save and restore machine basic block references from
the machine frame information class.
llvm-svn: 243575
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/MIR/X86/frame-info-save-restore-points.mir | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/X86/frame-info-save-restore-points.mir b/llvm/test/CodeGen/MIR/X86/frame-info-save-restore-points.mir new file mode 100644 index 00000000000..9bf8d0d77a9 --- /dev/null +++ b/llvm/test/CodeGen/MIR/X86/frame-info-save-restore-points.mir @@ -0,0 +1,72 @@ +# RUN: llc -march=x86-64 -enable-shrink-wrap=true -start-after shrink-wrap -stop-after shrink-wrap -o /dev/null %s | FileCheck %s +# This test ensures that the MIR parser parses the save and restore points in +# the machine frame info correctly. + +--- | + + define i32 @foo(i32 %a, i32 %b) { + entry: + %tmp = alloca i32, align 4 + %tmp2 = icmp slt i32 %a, %b + br i1 %tmp2, label %true, label %false + + true: + store i32 %a, i32* %tmp, align 4 + %tmp4 = call i32 @doSomething(i32 0, i32* %tmp) + br label %false + + false: + %tmp.0 = phi i32 [ %tmp4, %true ], [ %a, %entry ] + ret i32 %tmp.0 + } + + declare i32 @doSomething(i32, i32*) + +... +--- +name: foo +tracksRegLiveness: true +liveins: + - { reg: '%edi' } + - { reg: '%esi' } +# CHECK: frameInfo: +# CHECK: savePoint: '%bb.2.true' +# CHECK-NEXT: restorePoint: '%bb.2.true' +# CHECK: stack +frameInfo: + maxAlignment: 4 + hasCalls: true + savePoint: '%bb.2.true' + restorePoint: '%bb.2.true' +stack: + - { id: 0, name: tmp, offset: 0, size: 4, alignment: 4 } +body: + - id: 0 + successors: [ '%bb.2.true', '%bb.1' ] + liveins: [ '%edi', '%esi' ] + instructions: + - '%eax = COPY %edi' + - 'CMP32rr %eax, killed %esi, implicit-def %eflags' + - 'JL_1 %bb.2.true, implicit killed %eflags' + - id: 1 + successors: [ '%bb.3.false' ] + liveins: [ '%eax' ] + instructions: + - 'JMP_1 %bb.3.false' + - id: 2 + name: 'true' + successors: [ '%bb.3.false' ] + liveins: [ '%eax' ] + instructions: + - 'MOV32mr %stack.0.tmp, 1, _, 0, _, killed %eax' + - 'ADJCALLSTACKDOWN64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp' + - '%rsi = LEA64r %stack.0.tmp, 1, _, 0, _' + - '%edi = MOV32r0 implicit-def dead %eflags' + - 'CALL64pcrel32 @doSomething, csr_64, implicit %rsp, implicit %edi, implicit %rsi, implicit-def %rsp, implicit-def %eax' + - 'ADJCALLSTACKUP64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp' + - id: 3 + name: 'false' + liveins: [ '%eax' ] + instructions: + - 'RETQ %eax' +... |

