Debian Codegraph @

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-or-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: or_i8
6 body: |
7 bb.0.entry:
8 ; CHECK-LABEL: name: or_i8
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
10 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
11 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
12 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
13 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[TRUNC]], [[TRUNC1]]
14 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[OR]](s32)
15 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
16 ; CHECK-NEXT: PseudoRET implicit $x10
17 %0:_(s64) = COPY $x10
18 %1:_(s64) = COPY $x11
19 %2:_(s8) = G_TRUNC %0(s64)
20 %3:_(s8) = G_TRUNC %1(s64)
21 %4:_(s8) = G_OR %2, %3
22 %5:_(s64) = G_ANYEXT %4(s8)
23 $x10 = COPY %5(s64)
24 PseudoRET implicit $x10
25
26 ...
27 ---
28 name: or_i15
29 body: |
30 bb.0.entry:
31 ; CHECK-LABEL: name: or_i15
32 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
33 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
34 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
35 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
36 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[TRUNC]], [[TRUNC1]]
37 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[OR]](s32)
38 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
39 ; CHECK-NEXT: PseudoRET implicit $x10
40 %0:_(s64) = COPY $x10
41 %1:_(s64) = COPY $x11
42 %2:_(s15) = G_TRUNC %0(s64)
43 %3:_(s15) = G_TRUNC %1(s64)
44 %4:_(s15) = G_OR %2, %3
45 %5:_(s64) = G_ANYEXT %4(s15)
46 $x10 = COPY %5(s64)
47 PseudoRET implicit $x10
48
49 ...
50 ---
51 name: or_i16
52 body: |
53 bb.0.entry:
54 ; CHECK-LABEL: name: or_i16
55 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
56 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
57 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
58 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
59 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[TRUNC]], [[TRUNC1]]
60 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[OR]](s32)
61 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
62 ; CHECK-NEXT: PseudoRET implicit $x10
63 %0:_(s64) = COPY $x10
64 %1:_(s64) = COPY $x11
65 %2:_(s16) = G_TRUNC %0(s64)
66 %3:_(s16) = G_TRUNC %1(s64)
67 %4:_(s16) = G_OR %2, %3
68 %5:_(s64) = G_ANYEXT %4(s16)
69 $x10 = COPY %5(s64)
70 PseudoRET implicit $x10
71
72 ...
73 ---
74 name: or_i32
75 body: |
76 bb.0.entry:
77 ; CHECK-LABEL: name: or_i32
78 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
79 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
80 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
81 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
82 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[TRUNC]], [[TRUNC1]]
83 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[OR]](s32)
84 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
85 ; CHECK-NEXT: PseudoRET implicit $x10
86 %0:_(s64) = COPY $x10
87 %1:_(s64) = COPY $x11
88 %2:_(s32) = G_TRUNC %0(s64)
89 %3:_(s32) = G_TRUNC %1(s64)
90 %4:_(s32) = G_OR %2, %3
91 %5:_(s64) = G_ANYEXT %4(s32)
92 $x10 = COPY %5(s64)
93 PseudoRET implicit $x10
94
95 ...
96 ---
97 name: or_i64
98 body: |
99 bb.0.entry:
100 ; CHECK-LABEL: name: or_i64
101 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
102 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
103 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
104 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
105 ; CHECK-NEXT: PseudoRET implicit $x10
106 %0:_(s64) = COPY $x10
107 %1:_(s64) = COPY $x11
108 %2:_(s64) = G_OR %0, %1
109 $x10 = COPY %2(s64)
110 PseudoRET implicit $x10
111
112 ...
113 ---
114 name: or_i72
115 body: |
116 bb.0.entry:
117 ; CHECK-LABEL: name: or_i72
118 ; CHECK: %x00:_(s64) = COPY $x10
119 ; CHECK-NEXT: %x01:_(s64) = COPY $x11
120 ; CHECK-NEXT: %y00:_(s64) = COPY $x12
121 ; CHECK-NEXT: %y01:_(s64) = COPY $x13
122 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR %x00, %y00
123 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %x01, %y01
124 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
125 ; CHECK-NEXT: $x11 = COPY [[OR1]](s64)
126 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
127 %x00:_(s64) = COPY $x10
128 %x01:_(s64) = COPY $x11
129 %y00:_(s64) = COPY $x12
130 %y01:_(s64) = COPY $x13
131 %x0:_(s128) = G_MERGE_VALUES %x00(s64), %x01
132 %y0:_(s128) = G_MERGE_VALUES %y00(s64), %y01
133 %x:_(s72) = G_TRUNC %x0(s128)
134 %y:_(s72) = G_TRUNC %y0(s128)
135 %z:_(s72) = G_OR %x, %y
136 %z0:_(s128) = G_ANYEXT %z(s72)
137 %z00:_(s64), %z01:_(s64) = G_UNMERGE_VALUES %z0(s128)
138 $x10 = COPY %z00(s64)
139 $x11 = COPY %z01(s64)
140 PseudoRET implicit $x10, implicit $x11
141
142 ...
143 ---
144 name: or_i128
145 body: |
146 bb.0.entry:
147 ; CHECK-LABEL: name: or_i128
148 ; CHECK: %lo1:_(s64) = COPY $x10
149 ; CHECK-NEXT: %hi1:_(s64) = COPY $x11
150 ; CHECK-NEXT: %lo2:_(s64) = COPY $x12
151 ; CHECK-NEXT: %hi2:_(s64) = COPY $x13
152 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR %lo1, %lo2
153 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %hi1, %hi2
154 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
155 ; CHECK-NEXT: $x11 = COPY [[OR1]](s64)
156 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
157 %lo1:_(s64) = COPY $x10
158 %hi1:_(s64) = COPY $x11
159 %lo2:_(s64) = COPY $x12
160 %hi2:_(s64) = COPY $x13
161 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)
162 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)
163 %y:_(s128) = G_OR %x1, %x2
164 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)
165 $x10 = COPY %loy(s64)
166 $x11 = COPY %hiy(s64)
167 PseudoRET implicit $x10, implicit $x11
168
169 ...
170 ---
171 name: or_i192
172 body: |
173 bb.0.entry:
174 ; CHECK-LABEL: name: or_i192
175 ; CHECK: %lo1:_(s64) = COPY $x10
176 ; CHECK-NEXT: %mid1:_(s64) = COPY $x11
177 ; CHECK-NEXT: %hi1:_(s64) = COPY $x12
178 ; CHECK-NEXT: %lo2:_(s64) = COPY $x13
179 ; CHECK-NEXT: %mid2:_(s64) = COPY $x14
180 ; CHECK-NEXT: %hi2:_(s64) = COPY $x15
181 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR %lo1, %lo2
182 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %mid1, %mid2
183 ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s64) = G_OR %hi1, %hi2
184 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
185 ; CHECK-NEXT: $x11 = COPY [[OR1]](s64)
186 ; CHECK-NEXT: $x12 = COPY [[OR2]](s64)
187 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
188 %lo1:_(s64) = COPY $x10
189 %mid1:_(s64) = COPY $x11
190 %hi1:_(s64) = COPY $x12
191 %lo2:_(s64) = COPY $x13
192 %mid2:_(s64) = COPY $x14
193 %hi2:_(s64) = COPY $x15
194 %x1:_(s192) = G_MERGE_VALUES %lo1(s64), %mid1(s64), %hi1(s64)
195 %x2:_(s192) = G_MERGE_VALUES %lo2(s64), %mid2(s64), %hi2(s64)
196 %y:_(s192) = G_OR %x1, %x2
197 %lo:_(s64), %mid:_(s64), %hi:_(s64) = G_UNMERGE_VALUES %y(s192)
198 $x10 = COPY %lo(s64)
199 $x11 = COPY %mid(s64)
200 $x12 = COPY %hi(s64)
201 PseudoRET implicit $x10, implicit $x11, implicit $x12
202
203 ...