• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple powerpc64le-unknown-linux-gnu -x mir -mcpu=pwr8 -mattr=-altivec \
2# RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
3# RUN: FileCheck %s --check-prefixes=CHECK,SAVEONE
4
5# RUN: llc -mtriple powerpc64-unknown-linux-gnu -x mir -mcpu=pwr7 -mattr=-altivec \
6# RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
7# RUN: FileCheck %s --check-prefixes=CHECK,SAVEALL
8
9
10# RUN: llc -mtriple powerpc64-unknown-aix-xcoff -x mir -mcpu=pwr4 -mattr=-altivec \
11# RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
12# RUN: FileCheck %s --check-prefixes=CHECK,SAVEALL
13
14---
15name:            CRAllSave
16alignment:       16
17tracksRegLiveness: true
18liveins:
19  - { reg: '$x3', virtual-reg: '' }
20body:             |
21  bb.0.entry:
22    liveins: $x3
23    renamable $x29 = ANDI8_rec killed renamable $x3, 1, implicit-def dead $cr0, implicit-def $cr0gt
24    renamable $cr2lt = COPY $cr0gt
25    renamable $cr4lt = COPY $cr0gt
26    renamable $x3 = COPY $x29
27    BLR8 implicit $lr8, implicit $rm, implicit $x3
28
29    ; CHECK-LABEL: fixedStack:
30    ; CHECK-NEXT:     - { id: 0, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
31    ; CHECK-NEXT:         callee-saved-register: '$x29', callee-saved-restored: true, debug-info-variable: '',
32    ; CHECK-NEXT:         debug-info-expression: '', debug-info-location: '' }
33    ; CHECK-NEXT:     - { id: 1, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
34    ; CHECK-NEXT:         isImmutable: true, isAliased: false, callee-saved-register: '$cr4',
35    ; CHECK-NEXT:         callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
36    ; CHECK-NEXT:         debug-info-location: '' }
37    ; CHECK-LABEL:  stack:
38
39    ; Verify the proper live-ins have been added in the prologue.
40    ; CHECK:    liveins: $x3, $x29, $cr2, $cr4
41
42    ; CHECK:     $x12 = MFCR8 implicit killed $cr2, implicit killed $cr4
43    ; CHECK-DAG: STD killed $x29, -24, $x1 :: (store 8 into %fixed-stack.0)
44    ; CHECK-DAG: STW8 killed $x12, 8, $x1
45
46    ; CHECK:     $x29 = LD -24, $x1 :: (load 8 from %fixed-stack.0)
47    ; CHECK:     $x12 = LWZ8 8, $x1
48    ; CHECK:     $cr2 = MTOCRF8 $x12
49    ; CHECK:     $cr4 = MTOCRF8 killed $x12
50
51...
52---
53name:            CR2Save
54alignment:       16
55tracksRegLiveness: true
56liveins:
57  - { reg: '$x3', virtual-reg: '' }
58body:             |
59  bb.0.entry:
60    liveins: $x3
61    renamable $x14 = ANDI8_rec killed renamable $x3, 1, implicit-def dead $cr0, implicit-def $cr0gt
62    renamable $cr2lt = COPY $cr0gt
63    renamable $x3 = COPY $x14
64    BLR8 implicit $lr8, implicit $rm, implicit $x3
65
66    ; CHECK-LABEL: CR2Save
67
68    ; CHECK-LABEL: fixedStack:
69    ; CHECK-NEXT:   - { id: 0, type: spill-slot, offset: -144, size: 8, alignment: 16, stack-id: default,
70    ; CHECK-NEXT:       callee-saved-register: '$x14', callee-saved-restored: true, debug-info-variable: '',
71    ; CHECK-NEXT:       debug-info-expression: '', debug-info-location: '' }
72    ; CHECK-NEXT:   - { id: 1, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
73    ; CHECK-NEXT:       isImmutable: true, isAliased: false, callee-saved-register: '$cr2',
74    ; CHECK-NEXT:       callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
75    ; CHECK-NEXT:       debug-info-location: '' }
76    ; CHECK-LABEL:  stack:
77
78    ; Verify the proper live-ins have been added in the prologue.
79    ; CHECK:    liveins: $x3, $x14, $cr2
80
81    ; ELF V2 ABI allows saving only the clobbered cr fields,
82    ; whereas the other ABIs do not.
83    ; SAVEONE:     $x12 = MFOCRF8 killed $cr2
84    ; SAVEALL:     $x12 = MFCR8 implicit killed $cr2
85
86    ; CHECK-DAG: STD killed $x14, -144, $x1 :: (store 8 into %fixed-stack.0, align 16)
87    ; CHECK-DAG: STW8 killed $x12, 8, $x1
88
89    ; CHECK:     $x14 = LD -144, $x1 :: (load 8 from %fixed-stack.0, align 16)
90    ; CHECK:     $x12 = LWZ8 8, $x1
91    ; CHECK:     $cr2 = MTOCRF8 killed $x12
92
93
94...
95
96