1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple powerpc64le-unknown-linux-gnu -mcpu=pwr8 -x mir \
3 # RUN: -verify-machineinstrs -run-pass ppc-mi-peepholes < %s | FileCheck %s
7 tracksRegLiveness: true
11 ; CHECK-LABEL: name: fold_RLDICL_ANDI
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
15 ; CHECK-NEXT: dead [[RLDICL:%[0-9]+]]:g8rc = RLDICL [[COPY]], 0, 32
16 ; CHECK-NEXT: [[ANDI8_rec:%[0-9]+]]:g8rc = ANDI8_rec killed [[COPY]], 1, implicit-def dead $cr0
17 ; CHECK-NEXT: $x3 = COPY killed [[ANDI8_rec]]
18 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
20 %2:g8rc = RLDICL %1:g8rc, 0, 32
21 %3:g8rc = ANDI8_rec killed %2:g8rc, 1, implicit-def dead $cr0
23 BLR8 implicit $lr8, implicit $rm, implicit $x3
26 name: fold_RLDICL_ANDI2
27 tracksRegLiveness: true
31 ; CHECK-LABEL: name: fold_RLDICL_ANDI2
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
35 ; CHECK-NEXT: dead [[RLDICL:%[0-9]+]]:g8rc = RLDICL [[COPY]], 10, 60
36 ; CHECK-NEXT: [[ANDI8_rec:%[0-9]+]]:g8rc = ANDI8_rec killed [[COPY]], 0, implicit-def dead $cr0
37 ; CHECK-NEXT: $x3 = COPY killed [[ANDI8_rec]]
38 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
40 %2:g8rc = RLDICL %1:g8rc, 10, 60
41 %3:g8rc = ANDI8_rec killed %2:g8rc, 32, implicit-def dead $cr0
43 BLR8 implicit $lr8, implicit $rm, implicit $x3
46 name: fold_RLDICR_ANDI
47 tracksRegLiveness: true
51 ; CHECK-LABEL: name: fold_RLDICR_ANDI
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
55 ; CHECK-NEXT: dead [[RLDICR:%[0-9]+]]:g8rc = RLDICR [[COPY]], 0, 60
56 ; CHECK-NEXT: [[ANDI8_rec:%[0-9]+]]:g8rc = ANDI8_rec killed [[COPY]], 16, implicit-def dead $cr0
57 ; CHECK-NEXT: $x3 = COPY killed [[ANDI8_rec]]
58 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
60 %2:g8rc = RLDICR %1:g8rc, 0, 60
61 %3:g8rc = ANDI8_rec killed %2:g8rc, 16, implicit-def dead $cr0
63 BLR8 implicit $lr8, implicit $rm, implicit $x3
66 name: fold_RLDICR_ANDI2
67 tracksRegLiveness: true
71 ; CHECK-LABEL: name: fold_RLDICR_ANDI2
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
75 ; CHECK-NEXT: dead [[RLDICR:%[0-9]+]]:g8rc = RLDICR [[COPY]], 10, 60
76 ; CHECK-NEXT: [[ANDI8_rec:%[0-9]+]]:g8rc = ANDI8_rec killed [[COPY]], 0, implicit-def dead $cr0
77 ; CHECK-NEXT: $x3 = COPY killed [[ANDI8_rec]]
78 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
80 %2:g8rc = RLDICR %1:g8rc, 10, 60
81 %3:g8rc = ANDI8_rec killed %2:g8rc, 1, implicit-def dead $cr0
83 BLR8 implicit $lr8, implicit $rm, implicit $x3
86 name: fold_RLDICL_ANDIS
87 tracksRegLiveness: true
91 ; CHECK-LABEL: name: fold_RLDICL_ANDIS
94 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
95 ; CHECK-NEXT: dead [[RLDICL:%[0-9]+]]:g8rc = RLDICL [[COPY]], 0, 32
96 ; CHECK-NEXT: [[ANDIS8_rec:%[0-9]+]]:g8rc = ANDIS8_rec killed [[COPY]], 1, implicit-def dead $cr0
97 ; CHECK-NEXT: $x3 = COPY killed [[ANDIS8_rec]]
98 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
100 %2:g8rc = RLDICL %1:g8rc, 0, 32
101 %3:g8rc = ANDIS8_rec killed %2:g8rc, 1, implicit-def dead $cr0
103 BLR8 implicit $lr8, implicit $rm, implicit $x3
106 name: fold_RLDICL_ANDIS2
107 tracksRegLiveness: true
111 ; CHECK-LABEL: name: fold_RLDICL_ANDIS2
112 ; CHECK: liveins: $x3
114 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
115 ; CHECK-NEXT: dead [[RLDICL:%[0-9]+]]:g8rc = RLDICL [[COPY]], 10, 60
116 ; CHECK-NEXT: [[ANDIS8_rec:%[0-9]+]]:g8rc = ANDIS8_rec killed [[COPY]], 0, implicit-def dead $cr0
117 ; CHECK-NEXT: $x3 = COPY killed [[ANDIS8_rec]]
118 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
120 %2:g8rc = RLDICL %1:g8rc, 10, 60
121 %3:g8rc = ANDIS8_rec killed %2:g8rc, 16, implicit-def dead $cr0
123 BLR8 implicit $lr8, implicit $rm, implicit $x3
126 name: fold_RLDICR_ANDIS
127 tracksRegLiveness: true
131 ; CHECK-LABEL: name: fold_RLDICR_ANDIS
132 ; CHECK: liveins: $x3
134 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
135 ; CHECK-NEXT: dead [[RLDICR:%[0-9]+]]:g8rc = RLDICR [[COPY]], 0, 60
136 ; CHECK-NEXT: [[ANDIS8_rec:%[0-9]+]]:g8rc = ANDIS8_rec killed [[COPY]], 16, implicit-def dead $cr0
137 ; CHECK-NEXT: $x3 = COPY killed [[ANDIS8_rec]]
138 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
140 %2:g8rc = RLDICR %1:g8rc, 0, 60
141 %3:g8rc = ANDIS8_rec killed %2:g8rc, 16, implicit-def dead $cr0
143 BLR8 implicit $lr8, implicit $rm, implicit $x3
146 name: fold_RLDICR_ANDIS2
147 tracksRegLiveness: true
151 ; CHECK-LABEL: name: fold_RLDICR_ANDIS2
152 ; CHECK: liveins: $x3
154 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc = COPY killed $x3
155 ; CHECK-NEXT: dead [[RLDICR:%[0-9]+]]:g8rc = RLDICR [[COPY]], 10, 32
156 ; CHECK-NEXT: [[ANDIS8_rec:%[0-9]+]]:g8rc = ANDIS8_rec killed [[COPY]], 0, implicit-def dead $cr0
157 ; CHECK-NEXT: $x3 = COPY killed [[ANDIS8_rec]]
158 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
160 %2:g8rc = RLDICR %1:g8rc, 10, 32
161 %3:g8rc = ANDIS8_rec killed %2:g8rc, 1, implicit-def dead $cr0
163 BLR8 implicit $lr8, implicit $rm, implicit $x3