1 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu --verify-machineinstrs \
2 ; RUN: -stop-after=prologepilog < %s | FileCheck \
3 ; RUN: --check-prefixes=CHECK,CHECK64,ELFV2 %s
5 ; RUN: llc -mtriple=powerpc64-unknown-aix-xcoff -mcpu=pwr4 \
6 ; RUN: --verify-machineinstrs --mattr=-altivec -stop-after=prologepilog < %s | \
7 ; RUN: FileCheck --check-prefixes=CHECK,CHECK64,V1ANDAIX %s
9 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 --verify-machineinstrs \
10 ; RUN: -stop-after=prologepilog < %s | FileCheck \
11 ; RUN: --check-prefixes=CHECK,CHECK64,V1ANDAIX %s
13 ; RUN: llc -mtriple=powerpc-unknown-aix-xcoff -mcpu=pwr4 \
14 ; RUN: --verify-machineinstrs --mattr=-altivec -stop-after=prologepilog < %s | \
15 ; RUN: FileCheck --check-prefixes=CHECK,CHECK32 %s
17 define dso_local signext i32 @test(i32 signext %n) {
19 %conv = sext i32 %n to i64
20 %0 = alloca double, i64 %conv, align 16
21 tail call void asm sideeffect "", "~{cr2}"()
22 %call = call signext i32 @do_something(ptr nonnull %0)
26 declare signext i32 @do_something(ptr)
29 ; CHECK: alignment: 16
31 ; CHECK64: - { reg: '$x3', virtual-reg: '' }
32 ; CHECK32: - { reg: '$r3', virtual-reg: '' }
34 ; ELFV2: stackSize: 48
35 ; V1ANDAIX: stackSize: 128
36 ; CHECK32: stackSize: 80
38 ; ELFV2: maxCallFrameSize: 32
39 ; V1ANDAIX: maxCallFrameSize: 112
40 ; CHECK32: maxCallFrameSize: 64
42 ; CHECK64: fixedStack:
43 ; CHECK64-NEXT: - { id: 0, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
44 ; CHECK64-NEXT: isImmutable: true, isAliased: false, callee-saved-register: '$cr2',
45 ; CHECK64-NEXT: callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
46 ; CHECK64-NEXT: debug-info-location: '' }
47 ; CHECK64-NEXT: - { id: 1, type: default, offset: -8, size: 8, alignment: 8, stack-id: default,
48 ; CHECK64-NEXT: isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
49 ; CHECK64-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
51 ; CHECK64-NEXT: stack:
52 ; CHECK64-NEXT: - { id: 0, name: '', type: variable-sized, offset: -8, alignment: 1,
53 ; CHECK64-NEXT: stack-id: default, callee-saved-register: '', callee-saved-restored: true,
54 ; CHECK64-NEXT: local-offset: 0, debug-info-variable: '', debug-info-expression: '',
55 ; CHECK64-NEXT: debug-info-location: '' }
56 ; CHECK64-NEXT: - { id: 1, name: '', type: default, offset: -16, size: 8, alignment: 8,
57 ; CHECK64-NEXT: stack-id: default, callee-saved-register: '', callee-saved-restored: true,
58 ; CHECK64-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
61 ; CHECK32: fixedStack:
62 ; CHECK32-NEXT: - { id: 0, type: default, offset: 4, size: 4, alignment: 4, stack-id: default,
63 ; CHECK32-NEXT: isImmutable: true, isAliased: false, callee-saved-register: '$cr2',
64 ; CHECK32-NEXT: callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
65 ; CHECK32-NEXT: debug-info-location: '' }
66 ; CHECK32-NEXT: - { id: 1, type: default, offset: -4, size: 4, alignment: 4, stack-id: default,
67 ; CHECK32-NEXT: isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
68 ; CHECK32-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
70 ; CHECK32-NEXT: stack:
71 ; CHECK32-NEXT: - { id: 0, name: '', type: variable-sized, offset: -4, alignment: 1,
72 ; CHECK32-NEXT: stack-id: default, callee-saved-register: '', callee-saved-restored: true,
73 ; CHECK32-NEXT: local-offset: 0, debug-info-variable: '', debug-info-expression: '',
74 ; CHECK32-NEXT: debug-info-location: '' }
75 ; CHECK32-NEXT: - { id: 1, name: '', type: default, offset: -8, size: 4, alignment: 4,
76 ; CHECK32-NEXT: stack-id: default, callee-saved-register: '', callee-saved-restored: true,
77 ; CHECK32-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
80 ; CHECK64: bb.0.entry:
81 ; CHECK64-NEXT: liveins: $x3, $cr2
84 ; CHECK64: $x0 = MFLR8 implicit $lr8
85 ; ELFV2-NEXT: $x12 = MFOCRF8 killed $cr2
86 ; V1ANDAIX-NEXT: $x12 = MFCR8 implicit killed $cr2
87 ; CHECK64-DAG: STD $x31, -8, $x1
88 ; CHECK64-DAG: STW8 killed $x12, 8, $x1
90 ; ELFV2-NEXT: $x1 = STDU $x1, -48, $x1
91 ; ELFV2-NEXT: STD killed $x0, 64, $x1
92 ; V1ANDAIX-NEXT: x1 = STDU $x1, -128, $x1
93 ; V1ANDAIX-NEXT: STD killed $x0, 144, $x1
95 ; CHECK64: $x31 = OR8 $x1, $x1
97 ; ELFV2: $[[ORIGSP:x[0-9]+]] = ADDI8 $x31, 48
98 ; V1ANDAIX: $[[ORIGSP:x[0-9]+]] = ADDI8 $x31, 128
99 ; CHECK64: $x1 = STDUX killed $[[ORIGSP]], $x1, killed $x{{[0-9]}}
100 ; CHECK64: INLINEASM {{.*}} early-clobber $cr2
105 ; CHECK64: $x1 = LD 0, $x1
106 ; CHECK64-DAG: $x0 = LD 16, $x1
107 ; CHECK64-DAG: $x12 = LWZ8 8, $x1
108 ; CHECK64-DAG: $x31 = LD -8, $x1
109 ; CHECK64: $cr2 = MTOCRF8 killed $x12
110 ; CHECK64-NEXT: MTLR8 $x0, implicit-def $lr8
111 ; CHECK64-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3
113 ; CHECK32: bb.0.entry:
114 ; CHECK32-NEXT: liveins: $r3, $cr2
117 ; CHECK32: $r0 = MFLR implicit $lr
118 ; CHECK32-NEXT: $r12 = MFCR implicit killed $cr2
119 ; CHECK32-DAG: STW $r31, -4, $r1
120 ; CHECK32-DAG: STW killed $r12, 4, $r1
121 ; CHECK32: $r1 = STWU $r1, -80, $r1
122 ; CHECK32-NEXT: STW killed $r0, 88, $r1
124 ; CHECK32: $r31 = OR $r1, $r1
125 ; CHECK32: $[[ORIGSP:r[0-9]+]] = ADDI $r31, 80
126 ; CHECK32: $r1 = STWUX killed $[[ORIGSP]], $r1, killed $r{{[0-9]}}
127 ; CHECK32: INLINEASM {{.*}} early-clobber $cr2
131 ; CHECK32: $r1 = LWZ 0, $r1
132 ; CHECK32-DAG: $r0 = LWZ 8, $r1
133 ; CHECK32-DAG: $r12 = LWZ 4, $r1
134 ; CHECK32-DAG: $r31 = LWZ -4, $r1
135 ; CHECK32: $cr2 = MTOCRF killed $r12
136 ; CHECK32-NEXT: MTLR $r0, implicit-def $lr
137 ; CHECK32-NEXT: BLR implicit $lr, implicit $rm, implicit $r3