| 1 |
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec \ |
| 2 |
; RUN: -stop-after=machine-cp --verify-machineinstrs < %s | FileCheck \ |
| 3 |
; RUN: --check-prefixes=MIR,MIR32 %s |
| 4 |
|
| 5 |
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec \ |
| 6 |
; RUN: -stop-after=machine-cp --verify-machineinstrs < %s | FileCheck \ |
| 7 |
; RUN: --check-prefixes=MIR,MIR64 %s |
| 8 |
|
| 9 |
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec \ |
| 10 |
; RUN: --verify-machineinstrs < %s | FileCheck --check-prefixes=ASM,ASM32 %s |
| 11 |
|
| 12 |
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec \ |
| 13 |
; RUN: --verify-machineinstrs < %s | FileCheck --check-prefixes=ASM,ASM64 %s |
| 14 |
|
| 15 |
%struct.S = type { i8 } |
| 16 |
%struct.T = type { double, i32, i32, i32, float } |
| 17 |
|
| 18 |
define void @test1() { |
| 19 |
entry: |
| 20 |
%s = alloca %struct.S, align 8 |
| 21 |
call void @foo(ptr sret(%struct.S) %s) |
| 22 |
ret void |
| 23 |
} |
| 24 |
|
| 25 |
define void @test2() { |
| 26 |
entry: |
| 27 |
%t = alloca %struct.T, align 8 |
| 28 |
call void @bar(ptr sret(%struct.T) %t) |
| 29 |
ret void |
| 30 |
} |
| 31 |
|
| 32 |
declare void @foo(ptr sret(%struct.S)) |
| 33 |
declare void @bar(ptr sret(%struct.T)) |
| 34 |
|
| 35 |
; MIR: name: test1 |
| 36 |
; MIR: stack: |
| 37 |
; MIR-NEXT: - { id: 0, name: s, type: default, offset: 0, size: 1, alignment: 8, |
| 38 |
|
| 39 |
; MIR32: bb.0.entry: |
| 40 |
; MIR32-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 41 |
; MIR32-NEXT: renamable $r3 = ADDI %stack.0.s, 0 |
| 42 |
; MIR32-NEXT: BL_NOP <mcsymbol .foo[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r2, implicit-def $r1 |
| 43 |
; MIR32-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 44 |
|
| 45 |
; MIR64: bb.0.entry: |
| 46 |
; MIR64-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 47 |
; MIR64-NEXT: renamable $x3 = ADDI8 %stack.0.s, 0 |
| 48 |
; MIR64-NEXT: BL8_NOP <mcsymbol .foo[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1 |
| 49 |
; MIR64-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 50 |
|
| 51 |
|
| 52 |
; ASM-LABEL: .test1: |
| 53 |
|
| 54 |
; ASM32: stwu 1, -64(1) |
| 55 |
; ASM32-NEXT: addi 3, 1, 56 |
| 56 |
; ASM32-NEXT: stw 0, 72(1) |
| 57 |
; ASM32-NEXT: bl .foo[PR] |
| 58 |
; ASM32-NEXT: nop |
| 59 |
; ASM32-NEXT: addi 1, 1, 64 |
| 60 |
|
| 61 |
; ASM64: stdu 1, -128(1) |
| 62 |
; ASM64-NEXT: addi 3, 1, 120 |
| 63 |
; ASM64-NEXT: std 0, 144(1) |
| 64 |
; ASM64-NEXT: bl .foo[PR] |
| 65 |
; ASM64-NEXT: nop |
| 66 |
; ASM64-NEXT: addi 1, 1, 128 |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
; MIR: name: test2 |
| 71 |
; MIR: stack: |
| 72 |
; MIR-NEXT: - { id: 0, name: t, type: default, offset: 0, size: 24, alignment: 8, |
| 73 |
|
| 74 |
; MIR32: bb.0.entry: |
| 75 |
; MIR32-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 76 |
; MIR32-NEXT: renamable $r3 = ADDI %stack.0.t, 0 |
| 77 |
; MIR32-NEXT: BL_NOP <mcsymbol .bar[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r2, implicit-def $r1 |
| 78 |
; MIR32-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 79 |
|
| 80 |
; MIR64: bb.0.entry: |
| 81 |
; MIR64-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 82 |
; MIR64-NEXT: renamable $x3 = ADDI8 %stack.0.t, 0 |
| 83 |
; MIR64-NEXT: BL8_NOP <mcsymbol .bar[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1 |
| 84 |
; MIR64-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 85 |
|
| 86 |
|
| 87 |
; ASM-LABEL: .test2: |
| 88 |
|
| 89 |
; ASM32: stwu 1, -80(1) |
| 90 |
; ASM32-NEXT: addi 3, 1, 56 |
| 91 |
; ASM32-NEXT: stw 0, 88(1) |
| 92 |
; ASM32-NEXT: bl .bar[PR] |
| 93 |
; ASM32-NEXT: nop |
| 94 |
; ASM32-NEXT: addi 1, 1, 80 |
| 95 |
|
| 96 |
|
| 97 |
; ASM64: stdu 1, -144(1) |
| 98 |
; ASM64-NEXT: addi 3, 1, 120 |
| 99 |
; ASM64-NEXT: std 0, 160(1) |
| 100 |
; ASM64-NEXT: bl .bar[PR] |
| 101 |
; ASM64-NEXT: nop |
| 102 |
; ASM64-NEXT: addi 1, 1, 144 |