1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - \
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: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
12 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
13 ; CHECK-NEXT: PseudoRET implicit $x10
16 %2:_(s8) = G_TRUNC %0(s64)
17 %3:_(s8) = G_TRUNC %1(s64)
18 %4:_(s8) = G_OR %2, %3
19 %5:_(s64) = G_ANYEXT %4(s8)
21 PseudoRET implicit $x10
28 ; CHECK-LABEL: name: or_i15
29 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
30 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
31 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
32 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
33 ; CHECK-NEXT: PseudoRET implicit $x10
36 %2:_(s15) = G_TRUNC %0(s64)
37 %3:_(s15) = G_TRUNC %1(s64)
38 %4:_(s15) = G_OR %2, %3
39 %5:_(s64) = G_ANYEXT %4(s15)
41 PseudoRET implicit $x10
48 ; CHECK-LABEL: name: or_i16
49 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
51 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
52 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
53 ; CHECK-NEXT: PseudoRET implicit $x10
56 %2:_(s16) = G_TRUNC %0(s64)
57 %3:_(s16) = G_TRUNC %1(s64)
58 %4:_(s16) = G_OR %2, %3
59 %5:_(s64) = G_ANYEXT %4(s16)
61 PseudoRET implicit $x10
68 ; CHECK-LABEL: name: or_i32
69 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
70 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
71 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
72 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
73 ; CHECK-NEXT: PseudoRET implicit $x10
76 %2:_(s32) = G_TRUNC %0(s64)
77 %3:_(s32) = G_TRUNC %1(s64)
78 %4:_(s32) = G_OR %2, %3
79 %5:_(s64) = G_ANYEXT %4(s32)
81 PseudoRET implicit $x10
88 ; CHECK-LABEL: name: or_i64
89 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
91 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
92 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
93 ; CHECK-NEXT: PseudoRET implicit $x10
96 %2:_(s64) = G_OR %0, %1
98 PseudoRET implicit $x10
105 ; CHECK-LABEL: name: or_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: [[OR:%[0-9]+]]:_(s64) = G_OR %x00, %y00
111 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %x01, %y01
112 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
113 ; CHECK-NEXT: $x11 = COPY [[OR1]](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_OR %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
135 ; CHECK-LABEL: name: or_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: [[OR:%[0-9]+]]:_(s64) = G_OR %lo1, %lo2
141 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %hi1, %hi2
142 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
143 ; CHECK-NEXT: $x11 = COPY [[OR1]](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_OR %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
162 ; CHECK-LABEL: name: or_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: [[OR:%[0-9]+]]:_(s64) = G_OR %lo1, %lo2
170 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %mid1, %mid2
171 ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s64) = G_OR %hi1, %hi2
172 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
173 ; CHECK-NEXT: $x11 = COPY [[OR1]](s64)
174 ; CHECK-NEXT: $x12 = COPY [[OR2]](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_OR %x1, %x2
185 %lo:_(s64), %mid:_(s64), %hi:_(s64) = G_UNMERGE_VALUES %y(s192)
187 $x11 = COPY %mid(s64)
189 PseudoRET implicit $x10, implicit $x11, implicit $x12