220 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \3# RUN: | FileCheck %s4---5name: select_i76body: |7 bb.0.entry:8 ; CHECK-LABEL: name: select_i79 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1010 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1111 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x1212 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 113 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]14 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]15 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)16 ; CHECK-NEXT: PseudoRET implicit $x1017 %0:_(s32) = COPY $x1018 %1:_(s32) = COPY $x1119 %2:_(s32) = COPY $x1220 %3:_(s7) = G_TRUNC %0(s32)21 %4:_(s7) = G_TRUNC %1(s32)22 %5:_(s1) = G_TRUNC %2(s32)23 %6:_(s7) = G_SELECT %5(s1), %3(s7), %424 %7:_(s32) = G_ANYEXT %6(s7)25 $x10 = COPY %7(s32)26 PseudoRET implicit $x1027 28...29---30name: select_i831body: |32 bb.0.entry:33 ; CHECK-LABEL: name: select_i834 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1035 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1136 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x1237 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 138 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]39 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]40 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)41 ; CHECK-NEXT: PseudoRET implicit $x1042 %0:_(s32) = COPY $x1043 %1:_(s32) = COPY $x1144 %2:_(s32) = COPY $x1245 %3:_(s8) = G_TRUNC %0(s32)46 %4:_(s8) = G_TRUNC %1(s32)47 %5:_(s1) = G_TRUNC %2(s32)48 %6:_(s8) = G_SELECT %5(s1), %3(s8), %449 %7:_(s32) = G_ANYEXT %6(s8)50 $x10 = COPY %7(s32)51 PseudoRET implicit $x1052 53...54---55name: select_i1656body: |57 bb.0.entry:58 ; CHECK-LABEL: name: select_i1659 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1060 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1161 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x1262 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 163 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]64 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]65 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)66 ; CHECK-NEXT: PseudoRET implicit $x1067 %0:_(s32) = COPY $x1068 %1:_(s32) = COPY $x1169 %2:_(s32) = COPY $x1270 %3:_(s16) = G_TRUNC %0(s32)71 %4:_(s16) = G_TRUNC %1(s32)72 %5:_(s1) = G_TRUNC %2(s32)73 %6:_(s16) = G_SELECT %5(s1), %3(s16), %474 %7:_(s32) = G_ANYEXT %6(s16)75 $x10 = COPY %7(s32)76 PseudoRET implicit $x1077 78...79---80name: select_i3281body: |82 bb.0.entry:83 ; CHECK-LABEL: name: select_i3284 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1085 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1186 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x1287 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 188 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]89 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]90 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)91 ; CHECK-NEXT: PseudoRET implicit $x1092 %0:_(s32) = COPY $x1093 %1:_(s32) = COPY $x1194 %2:_(s32) = COPY $x1295 %3:_(s1) = G_TRUNC %2(s32)96 %4:_(s32) = G_SELECT %3(s1), %0(s32), %1(s32)97 $x10 = COPY %4(s32)98 PseudoRET implicit $x1099 100...101---102name: select_i48103body: |104 bb.0.entry:105 ; CHECK-LABEL: name: select_i48106 ; CHECK: %xhi:_(s32) = COPY $x10107 ; CHECK-NEXT: %xlo:_(s32) = COPY $x11108 ; CHECK-NEXT: %yhi:_(s32) = COPY $x12109 ; CHECK-NEXT: %ylo:_(s32) = COPY $x13110 ; CHECK-NEXT: %c0:_(s32) = COPY $x14111 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1112 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %c0, [[C]]113 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), %xhi, %yhi114 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), %xlo, %ylo115 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)116 ; CHECK-NEXT: $x11 = COPY [[SELECT1]](s32)117 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11118 %xhi:_(s32) = COPY $x10119 %xlo:_(s32) = COPY $x11120 %yhi:_(s32) = COPY $x12121 %ylo:_(s32) = COPY $x13122 %c0:_(s32) = COPY $x14123 %x0:_(s64) = G_MERGE_VALUES %xhi(s32), %xlo(s32)124 %y0:_(s64) = G_MERGE_VALUES %yhi(s32), %ylo(s32)125 %x:_(s48) = G_TRUNC %x0(s64)126 %y:_(s48) = G_TRUNC %y0(s64)127 %c:_(s1) = G_TRUNC %c0(s32)128 %z:_(s48) = G_SELECT %c(s1), %x(s48), %y129 %z0:_(s64) = G_ANYEXT %z(s48)130 %zhi:_(s32), %zlo:_(s32) = G_UNMERGE_VALUES %z0(s64)131 $x10 = COPY %zhi(s32)132 $x11 = COPY %zlo(s32)133 PseudoRET implicit $x10, implicit $x11134 135...136---137name: select_i64138body: |139 bb.0.entry:140 ; CHECK-LABEL: name: select_i64141 ; CHECK: %xhi:_(s32) = COPY $x10142 ; CHECK-NEXT: %xlo:_(s32) = COPY $x11143 ; CHECK-NEXT: %yhi:_(s32) = COPY $x12144 ; CHECK-NEXT: %ylo:_(s32) = COPY $x13145 ; CHECK-NEXT: %c0:_(s32) = COPY $x14146 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1147 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %c0, [[C]]148 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), %xhi, %yhi149 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), %xlo, %ylo150 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)151 ; CHECK-NEXT: $x11 = COPY [[SELECT1]](s32)152 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11153 %xhi:_(s32) = COPY $x10154 %xlo:_(s32) = COPY $x11155 %yhi:_(s32) = COPY $x12156 %ylo:_(s32) = COPY $x13157 %c0:_(s32) = COPY $x14158 %x:_(s64) = G_MERGE_VALUES %xhi(s32), %xlo(s32)159 %y:_(s64) = G_MERGE_VALUES %yhi(s32), %ylo(s32)160 %c:_(s1) = G_TRUNC %c0(s32)161 %z:_(s64) = G_SELECT %c(s1), %x(s64), %y162 %zhi:_(s32), %zlo:_(s32) = G_UNMERGE_VALUES %z(s64)163 $x10 = COPY %zhi(s32)164 $x11 = COPY %zlo(s32)165 PseudoRET implicit $x10, implicit $x11166 167...168---169name: select_i96170body: |171 bb.0.entry:172 ; CHECK-LABEL: name: select_i96173 ; CHECK: %yhi:_(s32) = COPY $x13174 ; CHECK-NEXT: %ymid:_(s32) = COPY $x14175 ; CHECK-NEXT: %ylo:_(s32) = COPY $x15176 ; CHECK-NEXT: $x10 = COPY %yhi(s32)177 ; CHECK-NEXT: $x11 = COPY %ymid(s32)178 ; CHECK-NEXT: $x12 = COPY %ylo(s32)179 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12180 %xhi:_(s32) = COPY $x10181 %xmid:_(s32) = COPY $x11182 %xlo:_(s32) = COPY $x12183 %yhi:_(s32) = COPY $x13184 %ymid:_(s32) = COPY $x14185 %ylo:_(s32) = COPY $x15186 %c0:_(s32) = COPY $x16187 %x:_(s96) = G_MERGE_VALUES %xhi(s32), %xmid(s32), %xlo(s32)188 %y:_(s96) = G_MERGE_VALUES %yhi(s32), %ymid(s32), %ylo(s32)189 %c:_(s1) = G_TRUNC %c0(s32)190 %z:_(s96) = G_SELECT %c(s1), %x(s96), %y191 %zhi:_(s32), %zmid:_(s32), %zlo:_(s32) = G_UNMERGE_VALUES %y(s96)192 $x10 = COPY %zhi(s32)193 $x11 = COPY %zmid(s32)194 $x12 = COPY %zlo(s32)195 PseudoRET implicit $x10, implicit $x11, implicit $x12196 197...198---199name: select_ptr200body: |201 bb.0.entry:202 ; CHECK-LABEL: name: select_ptr203 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x10204 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x11205 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12206 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1207 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]208 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]209 ; CHECK-NEXT: $x10 = COPY [[SELECT]](p0)210 ; CHECK-NEXT: PseudoRET implicit $x10211 %0:_(p0) = COPY $x10212 %1:_(p0) = COPY $x11213 %2:_(s32) = COPY $x12214 %3:_(s1) = G_TRUNC %2(s32)215 %4:_(p0) = G_SELECT %3(s1), %0(p0), %1(p0)216 $x10 = COPY %4(p0)217 PseudoRET implicit $x10218 219...220