Debian Codegraph @

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-and-rv64.mir

raw
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - \
3 # RUN: | FileCheck %s
4 ---
5 name: and_i8
6 body: |
7 bb.0.entry:
8 ; CHECK-LABEL: name: and_i8
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
10 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
11 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[COPY1]]
12 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
13 ; CHECK-NEXT: PseudoRET implicit $x10
14 %0:_(s64) = COPY $x10
15 %1:_(s64) = COPY $x11
16 %2:_(s8) = G_TRUNC %0(s64)
17 %3:_(s8) = G_TRUNC %1(s64)
18 %4:_(s8) = G_AND %2, %3
19 %5:_(s64) = G_ANYEXT %4(s8)
20 $x10 = COPY %5(s64)
21 PseudoRET implicit $x10
22
23 ...
24 ---
25 name: and_i15
26 body: |
27 bb.0.entry:
28 ; CHECK-LABEL: name: and_i15
29 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
30 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
31 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[COPY1]]
32 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
33 ; CHECK-NEXT: PseudoRET implicit $x10
34 %0:_(s64) = COPY $x10
35 %1:_(s64) = COPY $x11
36 %2:_(s15) = G_TRUNC %0(s64)
37 %3:_(s15) = G_TRUNC %1(s64)
38 %4:_(s15) = G_AND %2, %3
39 %5:_(s64) = G_ANYEXT %4(s15)
40 $x10 = COPY %5(s64)
41 PseudoRET implicit $x10
42
43 ...
44 ---
45 name: and_i16
46 body: |
47 bb.0.entry:
48 ; CHECK-LABEL: name: and_i16
49 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
51 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[COPY1]]
52 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
53 ; CHECK-NEXT: PseudoRET implicit $x10
54 %0:_(s64) = COPY $x10
55 %1:_(s64) = COPY $x11
56 %2:_(s16) = G_TRUNC %0(s64)
57 %3:_(s16) = G_TRUNC %1(s64)
58 %4:_(s16) = G_AND %2, %3
59 %5:_(s64) = G_ANYEXT %4(s16)
60 $x10 = COPY %5(s64)
61 PseudoRET implicit $x10
62
63 ...
64 ---
65 name: and_i32
66 body: |
67 bb.0.entry:
68 ; CHECK-LABEL: name: and_i32
69 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
70 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
71 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[COPY1]]
72 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
73 ; CHECK-NEXT: PseudoRET implicit $x10
74 %0:_(s64) = COPY $x10
75 %1:_(s64) = COPY $x11
76 %2:_(s32) = G_TRUNC %0(s64)
77 %3:_(s32) = G_TRUNC %1(s64)
78 %4:_(s32) = G_AND %2, %3
79 %5:_(s64) = G_ANYEXT %4(s32)
80 $x10 = COPY %5(s64)
81 PseudoRET implicit $x10
82
83 ...
84 ---
85 name: and_i64
86 body: |
87 bb.0.entry:
88 ; CHECK-LABEL: name: and_i64
89 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
91 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[COPY1]]
92 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
93 ; CHECK-NEXT: PseudoRET implicit $x10
94 %0:_(s64) = COPY $x10
95 %1:_(s64) = COPY $x11
96 %2:_(s64) = G_AND %0, %1
97 $x10 = COPY %2(s64)
98 PseudoRET implicit $x10
99
100 ...
101 ---
102 name: and_i72
103 body: |
104 bb.0.entry:
105 ; CHECK-LABEL: name: and_i72
106 ; CHECK: %x00:_(s64) = COPY $x10
107 ; CHECK-NEXT: %x01:_(s64) = COPY $x11
108 ; CHECK-NEXT: %y00:_(s64) = COPY $x12
109 ; CHECK-NEXT: %y01:_(s64) = COPY $x13
110 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %x00, %y00
111 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %x01, %y01
112 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
113 ; CHECK-NEXT: $x11 = COPY [[AND1]](s64)
114 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
115 %x00:_(s64) = COPY $x10
116 %x01:_(s64) = COPY $x11
117 %y00:_(s64) = COPY $x12
118 %y01:_(s64) = COPY $x13
119 %x0:_(s128) = G_MERGE_VALUES %x00(s64), %x01
120 %y0:_(s128) = G_MERGE_VALUES %y00(s64), %y01
121 %x:_(s72) = G_TRUNC %x0(s128)
122 %y:_(s72) = G_TRUNC %y0(s128)
123 %z:_(s72) = G_AND %x, %y
124 %z0:_(s128) = G_ANYEXT %z(s72)
125 %z00:_(s64), %z01:_(s64) = G_UNMERGE_VALUES %z0(s128)
126 $x10 = COPY %z00(s64)
127 $x11 = COPY %z01(s64)
128 PseudoRET implicit $x10, implicit $x11
129
130 ...
131 ---
132 name: and_i128
133 body: |
134 bb.0.entry:
135 ; CHECK-LABEL: name: and_i128
136 ; CHECK: %lo1:_(s64) = COPY $x10
137 ; CHECK-NEXT: %hi1:_(s64) = COPY $x11
138 ; CHECK-NEXT: %lo2:_(s64) = COPY $x12
139 ; CHECK-NEXT: %hi2:_(s64) = COPY $x13
140 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %lo1, %lo2
141 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %hi1, %hi2
142 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
143 ; CHECK-NEXT: $x11 = COPY [[AND1]](s64)
144 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
145 %lo1:_(s64) = COPY $x10
146 %hi1:_(s64) = COPY $x11
147 %lo2:_(s64) = COPY $x12
148 %hi2:_(s64) = COPY $x13
149 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)
150 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)
151 %y:_(s128) = G_AND %x1, %x2
152 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)
153 $x10 = COPY %loy(s64)
154 $x11 = COPY %hiy(s64)
155 PseudoRET implicit $x10, implicit $x11
156
157 ...
158 ---
159 name: and_i192
160 body: |
161 bb.0.entry:
162 ; CHECK-LABEL: name: and_i192
163 ; CHECK: %lo1:_(s64) = COPY $x10
164 ; CHECK-NEXT: %mid1:_(s64) = COPY $x11
165 ; CHECK-NEXT: %hi1:_(s64) = COPY $x12
166 ; CHECK-NEXT: %lo2:_(s64) = COPY $x13
167 ; CHECK-NEXT: %mid2:_(s64) = COPY $x14
168 ; CHECK-NEXT: %hi2:_(s64) = COPY $x15
169 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %lo1, %lo2
170 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %mid1, %mid2
171 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND %hi1, %hi2
172 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
173 ; CHECK-NEXT: $x11 = COPY [[AND1]](s64)
174 ; CHECK-NEXT: $x12 = COPY [[AND2]](s64)
175 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
176 %lo1:_(s64) = COPY $x10
177 %mid1:_(s64) = COPY $x11
178 %hi1:_(s64) = COPY $x12
179 %lo2:_(s64) = COPY $x13
180 %mid2:_(s64) = COPY $x14
181 %hi2:_(s64) = COPY $x15
182 %x1:_(s192) = G_MERGE_VALUES %lo1(s64), %mid1(s64), %hi1(s64)
183 %x2:_(s192) = G_MERGE_VALUES %lo2(s64), %mid2(s64), %hi2(s64)
184 %y:_(s192) = G_AND %x1, %x2
185 %lo:_(s64), %mid:_(s64), %hi:_(s64) = G_UNMERGE_VALUES %y(s192)
186 $x10 = COPY %lo(s64)
187 $x11 = COPY %mid(s64)
188 $x12 = COPY %hi(s64)
189 PseudoRET implicit $x10, implicit $x11, implicit $x12
190
191 ...