235 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: shl_i76body: |7 bb.0.entry:8 ; CHECK-LABEL: name: shl_i79 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1010 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1111 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 12712 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]13 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32)14 ; CHECK-NEXT: $x10 = COPY [[SHL]](s32)15 ; CHECK-NEXT: PseudoRET implicit $x1016 %0:_(s32) = COPY $x1017 %1:_(s32) = COPY $x1118 %2:_(s7) = G_TRUNC %0(s32)19 %3:_(s7) = G_TRUNC %1(s32)20 %4:_(s7) = G_SHL %2, %321 %5:_(s32) = G_ANYEXT %4(s7)22 $x10 = COPY %5(s32)23 PseudoRET implicit $x1024 25...26---27name: shl_i828body: |29 bb.0.entry:30 ; CHECK-LABEL: name: shl_i831 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1032 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1133 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 25534 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]35 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32)36 ; CHECK-NEXT: $x10 = COPY [[SHL]](s32)37 ; CHECK-NEXT: PseudoRET implicit $x1038 %0:_(s32) = COPY $x1039 %1:_(s32) = COPY $x1140 %2:_(s8) = G_TRUNC %0(s32)41 %3:_(s8) = G_TRUNC %1(s32)42 %4:_(s8) = G_SHL %2, %343 %5:_(s32) = G_ANYEXT %4(s8)44 $x10 = COPY %5(s32)45 PseudoRET implicit $x1046 47...48---49name: shl_i1650body: |51 bb.0.entry:52 ; CHECK-LABEL: name: shl_i1653 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1054 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1155 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6553556 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]57 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32)58 ; CHECK-NEXT: $x10 = COPY [[SHL]](s32)59 ; CHECK-NEXT: PseudoRET implicit $x1060 %0:_(s32) = COPY $x1061 %1:_(s32) = COPY $x1162 %2:_(s16) = G_TRUNC %0(s32)63 %3:_(s16) = G_TRUNC %1(s32)64 %4:_(s16) = G_SHL %2, %365 %5:_(s32) = G_ANYEXT %4(s16)66 $x10 = COPY %5(s32)67 PseudoRET implicit $x1068 69...70---71name: shl_i3272body: |73 bb.0.entry:74 ; CHECK-LABEL: name: shl_i3275 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1076 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1177 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[COPY1]](s32)78 ; CHECK-NEXT: $x10 = COPY [[SHL]](s32)79 ; CHECK-NEXT: PseudoRET implicit $x1080 %0:_(s32) = COPY $x1081 %1:_(s32) = COPY $x1182 %2:_(s32) = G_SHL %0, %183 $x10 = COPY %2(s32)84 PseudoRET implicit $x1085 86...87---88name: shl_i4889body: |90 bb.0.entry:91 ; CHECK-LABEL: name: shl_i4892 ; CHECK: %xlo:_(s32) = COPY $x1093 ; CHECK-NEXT: %xhi:_(s32) = COPY $x1194 ; CHECK-NEXT: %ylo:_(s32) = COPY $x1295 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3296 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB %ylo, [[C]]97 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C]], %ylo98 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 099 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), %ylo(s32), [[C]]100 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), %ylo(s32), [[C1]]101 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL %xlo, %ylo(s32)102 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR %xlo, [[SUB1]](s32)103 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL %xhi, %ylo(s32)104 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL1]]105 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL %xlo, [[SUB]](s32)106 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SHL]], [[C1]]107 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[OR]], [[SHL2]]108 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), %xhi, [[SELECT1]]109 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)110 ; CHECK-NEXT: $x11 = COPY [[SELECT2]](s32)111 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11112 %xlo:_(s32) = COPY $x10113 %xhi:_(s32) = COPY $x11114 %ylo:_(s32) = COPY $x12115 %yhi:_(s32) = COPY $x13116 %x0:_(s64) = G_MERGE_VALUES %xlo(s32), %xhi(s32)117 %y0:_(s64) = G_MERGE_VALUES %ylo(s32), %yhi(s32)118 %x:_(s48) = G_TRUNC %x0(s64)119 %y:_(s48) = G_TRUNC %y0(s64)120 %z:_(s48) = G_SHL %x, %y121 %z0:_(s64) = G_ANYEXT %z(s48)122 %zlo:_(s32), %zhi:_(s32) = G_UNMERGE_VALUES %z0(s64)123 $x10 = COPY %zlo(s32)124 $x11 = COPY %zhi(s32)125 PseudoRET implicit $x10, implicit $x11126 127...128---129name: shl_i64130body: |131 bb.0.entry:132 ; CHECK-LABEL: name: shl_i64133 ; CHECK: %lo1:_(s32) = COPY $x10134 ; CHECK-NEXT: %hi1:_(s32) = COPY $x11135 ; CHECK-NEXT: %lo2:_(s32) = COPY $x12136 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32137 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB %lo2, [[C]]138 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C]], %lo2139 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0140 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), %lo2(s32), [[C]]141 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), %lo2(s32), [[C1]]142 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL %lo1, %lo2(s32)143 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR %lo1, [[SUB1]](s32)144 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL %hi1, %lo2(s32)145 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL1]]146 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL %lo1, [[SUB]](s32)147 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SHL]], [[C1]]148 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[OR]], [[SHL2]]149 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), %hi1, [[SELECT1]]150 ; CHECK-NEXT: $x10 = COPY [[SELECT]](s32)151 ; CHECK-NEXT: $x11 = COPY [[SELECT2]](s32)152 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11153 %lo1:_(s32) = COPY $x10154 %hi1:_(s32) = COPY $x11155 %lo2:_(s32) = COPY $x12156 %hi2:_(s32) = COPY $x13157 %x1:_(s64) = G_MERGE_VALUES %lo1(s32), %hi1(s32)158 %x2:_(s64) = G_MERGE_VALUES %lo2(s32), %hi2(s32)159 %y:_(s64) = G_SHL %x1, %x2160 %loy:_(s32), %hiy:_(s32) = G_UNMERGE_VALUES %y(s64)161 $x10 = COPY %loy(s32)162 $x11 = COPY %hiy(s32)163 PseudoRET implicit $x10, implicit $x11164 165...166---167name: shl_i96168body: |169 bb.0.entry:170 ; CHECK-LABEL: name: shl_i96171 ; CHECK: %lo1:_(s32) = COPY $x10172 ; CHECK-NEXT: %mid1:_(s32) = COPY $x11173 ; CHECK-NEXT: %hi1:_(s32) = COPY $x12174 ; CHECK-NEXT: %lo2:_(s32) = COPY $x13175 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 64176 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB %lo2, [[C]]177 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C]], %lo2178 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0179 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), %lo2(s32), [[C]]180 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), %lo2(s32), [[C1]]181 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 32182 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB %lo2, [[C2]]183 ; CHECK-NEXT: [[SUB3:%[0-9]+]]:_(s32) = G_SUB [[C2]], %lo2184 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), %lo2(s32), [[C2]]185 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), %lo2(s32), [[C1]]186 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL %lo1, %lo2(s32)187 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR %lo1, [[SUB3]](s32)188 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL %mid1, %lo2(s32)189 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL1]]190 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL %lo1, [[SUB2]](s32)191 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[SHL]], [[C1]]192 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[OR]], [[SHL2]]193 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[ICMP3]](s32), %mid1, [[SELECT1]]194 ; CHECK-NEXT: [[SUB4:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[C2]]195 ; CHECK-NEXT: [[SUB5:%[0-9]+]]:_(s32) = G_SUB [[C2]], [[SUB1]]196 ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB1]](s32), [[C2]]197 ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[SUB1]](s32), [[C1]]198 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR %lo1, [[SUB1]](s32)199 ; CHECK-NEXT: [[SHL3:%[0-9]+]]:_(s32) = G_SHL %mid1, [[SUB5]](s32)200 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[LSHR1]], [[SHL3]]201 ; CHECK-NEXT: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR %mid1, [[SUB4]](s32)202 ; CHECK-NEXT: [[SELECT3:%[0-9]+]]:_(s32) = G_SELECT [[ICMP4]](s32), [[OR1]], [[LSHR2]]203 ; CHECK-NEXT: [[SELECT4:%[0-9]+]]:_(s32) = G_SELECT [[ICMP5]](s32), %lo1, [[SELECT3]]204 ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), %lo2(s32), [[C2]]205 ; CHECK-NEXT: [[SHL4:%[0-9]+]]:_(s32) = G_SHL %hi1, %lo2(s32)206 ; CHECK-NEXT: [[SELECT5:%[0-9]+]]:_(s32) = G_SELECT [[ICMP6]](s32), [[SHL4]], [[C1]]207 ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[SELECT4]], [[SELECT5]]208 ; CHECK-NEXT: [[ICMP7:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB]](s32), [[C2]]209 ; CHECK-NEXT: [[SHL5:%[0-9]+]]:_(s32) = G_SHL %lo1, [[SUB]](s32)210 ; CHECK-NEXT: [[SELECT6:%[0-9]+]]:_(s32) = G_SELECT [[ICMP7]](s32), [[SHL5]], [[C1]]211 ; CHECK-NEXT: [[SELECT7:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SELECT]], [[C1]]212 ; CHECK-NEXT: [[SELECT8:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SELECT2]], [[C1]]213 ; CHECK-NEXT: [[SELECT9:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[OR2]], [[SELECT6]]214 ; CHECK-NEXT: [[SELECT10:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), %hi1, [[SELECT9]]215 ; CHECK-NEXT: $x10 = COPY [[SELECT7]](s32)216 ; CHECK-NEXT: $x11 = COPY [[SELECT8]](s32)217 ; CHECK-NEXT: $x12 = COPY [[SELECT10]](s32)218 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12219 %lo1:_(s32) = COPY $x10220 %mid1:_(s32) = COPY $x11221 %hi1:_(s32) = COPY $x12222 %lo2:_(s32) = COPY $x13223 %mid2:_(s32) = COPY $x14224 %hi2:_(s32) = COPY $x15225 %x1:_(s96) = G_MERGE_VALUES %lo1(s32), %mid1(s32), %hi1(s32)226 %x2:_(s96) = G_MERGE_VALUES %lo2(s32), %mid2(s32), %hi2(s32)227 %y:_(s96) = G_SHL %x1, %x2228 %lo:_(s32), %mid:_(s32), %hi:_(s32) = G_UNMERGE_VALUES %y(s96)229 $x10 = COPY %lo(s32)230 $x11 = COPY %mid(s32)231 $x12 = COPY %hi(s32)232 PseudoRET implicit $x10, implicit $x11, implicit $x12233 234...235