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
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
9 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec \
10 ; RUN: --verify-machineinstrs < %s | FileCheck --check-prefixes=ASM,ASM32 %s
12 ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec \
13 ; RUN: --verify-machineinstrs < %s | FileCheck --check-prefixes=ASM,ASM64 %s
15 %struct.S = type { i8 }
16 %struct.T = type { double, i32, i32, i32, float }
18 define void @test1() {
20 %s = alloca %struct.S, align 8
21 call void @foo(ptr sret(%struct.S) %s)
25 define void @test2() {
27 %t = alloca %struct.T, align 8
28 call void @bar(ptr sret(%struct.T) %t)
32 declare void @foo(ptr sret(%struct.S))
33 declare void @bar(ptr sret(%struct.T))
37 ; MIR-NEXT: - { id: 0, name: s, type: default, offset: 0, size: 1, alignment: 8,
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
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
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]
59 ; ASM32-NEXT: addi 1, 1, 64
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]
66 ; ASM64-NEXT: addi 1, 1, 128
72 ; MIR-NEXT: - { id: 0, name: t, type: default, offset: 0, size: 24, alignment: 8,
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
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
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]
94 ; ASM32-NEXT: addi 1, 1, 80
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]
102 ; ASM64-NEXT: addi 1, 1, 144