1# RUN: llc -mtriple powerpc64-unknown-linux-gnu -run-pass=ppc-expand-isel -o \
2# RUN:   - %s -verify-machineinstrs | FileCheck %s
3
4---
5name:           expand_isel_liveness1
6tracksRegLiveness: true
7registers:       []
8liveins:
9  - { reg: '$x3', virtual-reg: '' }
10  - { reg: '$x4', virtual-reg: '' }
11  - { reg: '$x5', virtual-reg: '' }
12  - { reg: '$x6', virtual-reg: '' }
13body:             |
14  bb.0:
15    liveins: $x3, $x4, $x5, $x6
16
17    renamable $x8 = MULLD renamable $x5, renamable $x4
18    renamable $cr5 = CMPDI renamable $x3, 0
19    dead renamable $x9 = MULHDU_rec renamable $x3, renamable $x6, implicit-def $cr0
20    renamable $x3 = MULLD killed renamable $x3, renamable $x6
21    $cr1 = MCRF killed $cr0
22    renamable $x3 = ADD8 killed renamable $x3, killed renamable $x8
23    renamable $cr0 = CMPDI renamable $x5, 0
24    renamable $cr5lt = CRNOR killed renamable $cr0eq, killed renamable $cr5eq, implicit $cr5, implicit $cr0
25    renamable $cr0 = CMPLDI renamable $x3, 0
26    renamable $x8 = MULHDU renamable $x4, renamable $x6
27    renamable $x3 = ADD8 renamable $x8, killed renamable $x3
28    renamable $cr6 = CMPLD renamable $x3, killed renamable $x8
29    renamable $cr5gt = CRANDC killed renamable $cr6lt, killed renamable $cr0eq, implicit $cr0, implicit $cr6
30    renamable $cr5lt = CRORC killed renamable $cr5lt, killed renamable $cr1eq, implicit $cr1
31    renamable $x7 = LI8 1
32    dead renamable $x5 = MULHDU_rec killed renamable $x5, renamable $x4, implicit-def $cr0
33    renamable $cr5lt = CRORC killed renamable $cr5lt, killed renamable $cr0eq, implicit $cr0
34    renamable $cr5lt = CRNOR killed renamable $cr5lt, killed renamable $cr5gt
35    renamable $x4 = MULLD killed renamable $x4, killed renamable $x6
36    renamable $x5 = ISEL8 $zero8, killed renamable $x7, killed renamable $cr5lt
37    BLR8 implicit $lr8, implicit $rm, implicit killed $x3, implicit killed $x4, implicit killed $x5
38
39  ; CHECK-LABEL: name: expand_isel_liveness1
40  ; CHECK: bb.1:
41  ; CHECK:   liveins: $x3, $x4, $x7
42  ; CHECK:   renamable $x5 = ORI8 killed renamable $x7, 0
43  ; CHECK:   B %bb.3
44  ; CHECK: bb.2:
45  ; CHECK:   liveins: $x3, $x4
46  ; CHECK:   renamable $x5 = ADDI8 $zero8, 0
47  ; CHECK: bb.3:
48  ; CHECK:   liveins: $x3, $x4, $x5
49  ; CHECK:   BLR8 implicit $lr8, implicit $rm, implicit killed $x3, implicit killed $x4, implicit killed $x5
50...
51
52---
53name:            expand_isel_liveness2
54tracksRegLiveness: true
55liveins:
56  - { reg: '$r0' }
57  - { reg: '$r3' }
58body:             |
59  bb.0.entry:
60    liveins: $r0, $r3
61
62    $r5 = ADDI $r3, 1
63    $cr0 = CMPWI $r3, 0
64    $r3 = ISEL $zero, killed $r0, killed $cr0gt
65
66  ; CHECK-LABEL: name: expand_isel_liveness2
67  ; CHECK: bb.0.entry:
68  ; CHECK:   liveins: $r0, $r3
69  ; CHECK:   $r5 = ADDI $r3, 1
70  ; CHECK:   $cr0 = CMPWI $r3, 0
71  ; CHECK:   BC killed $cr0gt, %bb.2
72  ; CHECK: bb.1.entry:
73  ; CHECK:   liveins: $r0
74  ; CHECK:   $r3 = ORI killed $r0, 0
75  ; CHECK:   B %bb.3
76  ; CHECK: bb.2.entry:
77  ; CHECK-NOT:   liveins: $zero
78  ; CHECK:   $r3 = ADDI $zero, 0
79...
80
81