611 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - \3# RUN: | FileCheck %s -check-prefix=CHECK-I4# RUN: llc -mattr=+m -mtriple=riscv64 -run-pass=legalizer %s -o - \5# RUN: | FileCheck %s -check-prefix=CHECK-M6---7name: srem_i88body: |9 bb.0.entry:10 ; CHECK-I-LABEL: name: srem_i811 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x1012 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1113 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 5614 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)15 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)16 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)17 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)18 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x219 ; CHECK-I-NEXT: $x10 = COPY [[ASHR]](s64)20 ; CHECK-I-NEXT: $x11 = COPY [[ASHR1]](s64)21 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1022 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x223 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x1024 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)25 ; CHECK-I-NEXT: PseudoRET implicit $x1026 ;27 ; CHECK-M-LABEL: name: srem_i828 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x1029 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1130 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 5631 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)32 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)33 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)34 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)35 ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[ASHR]], [[ASHR1]]36 ; CHECK-M-NEXT: $x10 = COPY [[SREM]](s64)37 ; CHECK-M-NEXT: PseudoRET implicit $x1038 %0:_(s64) = COPY $x1039 %1:_(s64) = COPY $x1140 %2:_(s8) = G_TRUNC %0(s64)41 %3:_(s8) = G_TRUNC %1(s64)42 %4:_(s8) = G_SREM %2, %343 %5:_(s64) = G_ANYEXT %4(s8)44 $x10 = COPY %5(s64)45 PseudoRET implicit $x1046 47...48---49name: srem_i1550body: |51 bb.0.entry:52 ; CHECK-I-LABEL: name: srem_i1553 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x1054 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1155 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4956 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)57 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)58 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)59 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)60 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x261 ; CHECK-I-NEXT: $x10 = COPY [[ASHR]](s64)62 ; CHECK-I-NEXT: $x11 = COPY [[ASHR1]](s64)63 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1064 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x265 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x1066 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)67 ; CHECK-I-NEXT: PseudoRET implicit $x1068 ;69 ; CHECK-M-LABEL: name: srem_i1570 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x1071 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1172 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4973 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)74 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)75 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)76 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)77 ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[ASHR]], [[ASHR1]]78 ; CHECK-M-NEXT: $x10 = COPY [[SREM]](s64)79 ; CHECK-M-NEXT: PseudoRET implicit $x1080 %0:_(s64) = COPY $x1081 %1:_(s64) = COPY $x1182 %2:_(s15) = G_TRUNC %0(s64)83 %3:_(s15) = G_TRUNC %1(s64)84 %4:_(s15) = G_SREM %2, %385 %5:_(s64) = G_ANYEXT %4(s15)86 $x10 = COPY %5(s64)87 PseudoRET implicit $x1088 89...90---91name: srem_i1692body: |93 bb.0.entry:94 ; CHECK-I-LABEL: name: srem_i1695 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x1096 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1197 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4898 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)99 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)100 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)101 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)102 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2103 ; CHECK-I-NEXT: $x10 = COPY [[ASHR]](s64)104 ; CHECK-I-NEXT: $x11 = COPY [[ASHR1]](s64)105 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10106 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2107 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10108 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)109 ; CHECK-I-NEXT: PseudoRET implicit $x10110 ;111 ; CHECK-M-LABEL: name: srem_i16112 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10113 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11114 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48115 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)116 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)117 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)118 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)119 ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[ASHR]], [[ASHR1]]120 ; CHECK-M-NEXT: $x10 = COPY [[SREM]](s64)121 ; CHECK-M-NEXT: PseudoRET implicit $x10122 %0:_(s64) = COPY $x10123 %1:_(s64) = COPY $x11124 %2:_(s16) = G_TRUNC %0(s64)125 %3:_(s16) = G_TRUNC %1(s64)126 %4:_(s16) = G_SREM %2, %3127 %5:_(s64) = G_ANYEXT %4(s16)128 $x10 = COPY %5(s64)129 PseudoRET implicit $x10130 131...132---133name: srem_i32134body: |135 bb.0.entry:136 ; CHECK-I-LABEL: name: srem_i32137 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10138 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11139 ; CHECK-I-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32140 ; CHECK-I-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32141 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2142 ; CHECK-I-NEXT: $x10 = COPY [[SEXT_INREG]](s64)143 ; CHECK-I-NEXT: $x11 = COPY [[SEXT_INREG1]](s64)144 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10145 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2146 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10147 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)148 ; CHECK-I-NEXT: PseudoRET implicit $x10149 ;150 ; CHECK-M-LABEL: name: srem_i32151 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10152 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11153 ; CHECK-M-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32154 ; CHECK-M-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32155 ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[SEXT_INREG]], [[SEXT_INREG1]]156 ; CHECK-M-NEXT: $x10 = COPY [[SREM]](s64)157 ; CHECK-M-NEXT: PseudoRET implicit $x10158 %0:_(s64) = COPY $x10159 %1:_(s64) = COPY $x11160 %2:_(s32) = G_TRUNC %0(s64)161 %3:_(s32) = G_TRUNC %1(s64)162 %4:_(s32) = G_SREM %2, %3163 %5:_(s64) = G_ANYEXT %4(s32)164 $x10 = COPY %5(s64)165 PseudoRET implicit $x10166 167...168---169name: srem_i64170body: |171 bb.0.entry:172 ; CHECK-I-LABEL: name: srem_i64173 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10174 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11175 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2176 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)177 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)178 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10179 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2180 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10181 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)182 ; CHECK-I-NEXT: PseudoRET implicit $x10183 ;184 ; CHECK-M-LABEL: name: srem_i64185 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10186 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11187 ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[COPY]], [[COPY1]]188 ; CHECK-M-NEXT: $x10 = COPY [[SREM]](s64)189 ; CHECK-M-NEXT: PseudoRET implicit $x10190 %0:_(s64) = COPY $x10191 %1:_(s64) = COPY $x11192 %2:_(s64) = G_SREM %0, %1193 $x10 = COPY %2(s64)194 PseudoRET implicit $x10195 196...197---198name: srem_i72199body: |200 bb.0.entry:201 ; CHECK-I-LABEL: name: srem_i72202 ; CHECK-I: %xlo:_(s64) = COPY $x10203 ; CHECK-I-NEXT: %xhi:_(s64) = COPY $x11204 ; CHECK-I-NEXT: %ylo:_(s64) = COPY $x12205 ; CHECK-I-NEXT: %yhi:_(s64) = COPY $x13206 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56207 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL %xhi, [[C]](s64)208 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)209 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL %yhi, [[C]](s64)210 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)211 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2212 ; CHECK-I-NEXT: $x10 = COPY %xlo(s64)213 ; CHECK-I-NEXT: $x11 = COPY [[ASHR]](s64)214 ; CHECK-I-NEXT: $x12 = COPY %ylo(s64)215 ; CHECK-I-NEXT: $x13 = COPY [[ASHR1]](s64)216 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__modti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11217 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2218 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10219 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11220 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)221 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)222 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11223 ;224 ; CHECK-M-LABEL: name: srem_i72225 ; CHECK-M: %xlo:_(s64) = COPY $x10226 ; CHECK-M-NEXT: %xhi:_(s64) = COPY $x11227 ; CHECK-M-NEXT: %ylo:_(s64) = COPY $x12228 ; CHECK-M-NEXT: %yhi:_(s64) = COPY $x13229 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56230 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL %xhi, [[C]](s64)231 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)232 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL %yhi, [[C]](s64)233 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)234 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2235 ; CHECK-M-NEXT: $x10 = COPY %xlo(s64)236 ; CHECK-M-NEXT: $x11 = COPY [[ASHR]](s64)237 ; CHECK-M-NEXT: $x12 = COPY %ylo(s64)238 ; CHECK-M-NEXT: $x13 = COPY [[ASHR1]](s64)239 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__modti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11240 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2241 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10242 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11243 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)244 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)245 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11246 %xlo:_(s64) = COPY $x10247 %xhi:_(s64) = COPY $x11248 %ylo:_(s64) = COPY $x12249 %yhi:_(s64) = COPY $x13250 %x0:_(s128) = G_MERGE_VALUES %xlo(s64), %xhi(s64)251 %y0:_(s128) = G_MERGE_VALUES %ylo(s64), %yhi(s64)252 %x:_(s72) = G_TRUNC %x0253 %y:_(s72) = G_TRUNC %y0254 %z:_(s72) = G_SREM %x, %y255 %z0:_(s128) = G_ANYEXT %z256 %zlo:_(s64), %zhi:_(s64) = G_UNMERGE_VALUES %z0(s128)257 $x10 = COPY %zlo(s64)258 $x11 = COPY %zhi(s64)259 PseudoRET implicit $x10, implicit $x11260 261...262---263name: srem_i128264body: |265 bb.0.entry:266 ; CHECK-I-LABEL: name: srem_i128267 ; CHECK-I: %lo1:_(s64) = COPY $x10268 ; CHECK-I-NEXT: %hi1:_(s64) = COPY $x11269 ; CHECK-I-NEXT: %lo2:_(s64) = COPY $x12270 ; CHECK-I-NEXT: %hi2:_(s64) = COPY $x13271 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2272 ; CHECK-I-NEXT: $x10 = COPY %lo1(s64)273 ; CHECK-I-NEXT: $x11 = COPY %hi1(s64)274 ; CHECK-I-NEXT: $x12 = COPY %lo2(s64)275 ; CHECK-I-NEXT: $x13 = COPY %hi2(s64)276 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__modti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11277 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2278 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10279 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11280 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)281 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)282 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11283 ;284 ; CHECK-M-LABEL: name: srem_i128285 ; CHECK-M: %lo1:_(s64) = COPY $x10286 ; CHECK-M-NEXT: %hi1:_(s64) = COPY $x11287 ; CHECK-M-NEXT: %lo2:_(s64) = COPY $x12288 ; CHECK-M-NEXT: %hi2:_(s64) = COPY $x13289 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2290 ; CHECK-M-NEXT: $x10 = COPY %lo1(s64)291 ; CHECK-M-NEXT: $x11 = COPY %hi1(s64)292 ; CHECK-M-NEXT: $x12 = COPY %lo2(s64)293 ; CHECK-M-NEXT: $x13 = COPY %hi2(s64)294 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__modti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11295 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2296 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10297 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11298 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)299 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)300 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11301 %lo1:_(s64) = COPY $x10302 %hi1:_(s64) = COPY $x11303 %lo2:_(s64) = COPY $x12304 %hi2:_(s64) = COPY $x13305 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)306 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)307 %y:_(s128) = G_SREM %x1, %x2308 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)309 $x10 = COPY %loy(s64)310 $x11 = COPY %hiy(s64)311 PseudoRET implicit $x10, implicit $x11312 313...314---315name: urem_i8316body: |317 bb.0.entry:318 ; CHECK-I-LABEL: name: urem_i8319 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10320 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11321 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255322 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]323 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]324 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2325 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)326 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)327 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10328 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2329 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10330 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)331 ; CHECK-I-NEXT: PseudoRET implicit $x10332 ;333 ; CHECK-M-LABEL: name: urem_i8334 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10335 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11336 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255337 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]338 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]339 ; CHECK-M-NEXT: [[REMUW:%[0-9]+]]:_(s64) = G_REMUW [[AND]], [[AND1]]340 ; CHECK-M-NEXT: $x10 = COPY [[REMUW]](s64)341 ; CHECK-M-NEXT: PseudoRET implicit $x10342 %0:_(s64) = COPY $x10343 %1:_(s64) = COPY $x11344 %2:_(s8) = G_TRUNC %0(s64)345 %3:_(s8) = G_TRUNC %1(s64)346 %4:_(s8) = G_UREM %2, %3347 %5:_(s64) = G_ANYEXT %4(s8)348 $x10 = COPY %5(s64)349 PseudoRET implicit $x10350 351...352---353name: urem_i15354body: |355 bb.0.entry:356 ; CHECK-I-LABEL: name: urem_i15357 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10358 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11359 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32767360 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]361 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]362 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2363 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)364 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)365 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10366 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2367 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10368 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)369 ; CHECK-I-NEXT: PseudoRET implicit $x10370 ;371 ; CHECK-M-LABEL: name: urem_i15372 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10373 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11374 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32767375 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]376 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]377 ; CHECK-M-NEXT: [[REMUW:%[0-9]+]]:_(s64) = G_REMUW [[AND]], [[AND1]]378 ; CHECK-M-NEXT: $x10 = COPY [[REMUW]](s64)379 ; CHECK-M-NEXT: PseudoRET implicit $x10380 %0:_(s64) = COPY $x10381 %1:_(s64) = COPY $x11382 %2:_(s15) = G_TRUNC %0(s64)383 %3:_(s15) = G_TRUNC %1(s64)384 %4:_(s15) = G_UREM %2, %3385 %5:_(s64) = G_ANYEXT %4(s15)386 $x10 = COPY %5(s64)387 PseudoRET implicit $x10388 389...390---391name: urem_i16392body: |393 bb.0.entry:394 ; CHECK-I-LABEL: name: urem_i16395 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10396 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11397 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535398 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]399 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]400 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2401 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)402 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)403 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10404 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2405 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10406 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)407 ; CHECK-I-NEXT: PseudoRET implicit $x10408 ;409 ; CHECK-M-LABEL: name: urem_i16410 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10411 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11412 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535413 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]414 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]415 ; CHECK-M-NEXT: [[REMUW:%[0-9]+]]:_(s64) = G_REMUW [[AND]], [[AND1]]416 ; CHECK-M-NEXT: $x10 = COPY [[REMUW]](s64)417 ; CHECK-M-NEXT: PseudoRET implicit $x10418 %0:_(s64) = COPY $x10419 %1:_(s64) = COPY $x11420 %2:_(s16) = G_TRUNC %0(s64)421 %3:_(s16) = G_TRUNC %1(s64)422 %4:_(s16) = G_UREM %2, %3423 %5:_(s64) = G_ANYEXT %4(s16)424 $x10 = COPY %5(s64)425 PseudoRET implicit $x10426 427...428---429name: urem_i32430body: |431 bb.0.entry:432 ; CHECK-I-LABEL: name: urem_i32433 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10434 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11435 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295436 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]437 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]438 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2439 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)440 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)441 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10442 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2443 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10444 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)445 ; CHECK-I-NEXT: PseudoRET implicit $x10446 ;447 ; CHECK-M-LABEL: name: urem_i32448 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10449 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11450 ; CHECK-M-NEXT: [[REMUW:%[0-9]+]]:_(s64) = G_REMUW [[COPY]], [[COPY1]]451 ; CHECK-M-NEXT: $x10 = COPY [[REMUW]](s64)452 ; CHECK-M-NEXT: PseudoRET implicit $x10453 %0:_(s64) = COPY $x10454 %1:_(s64) = COPY $x11455 %2:_(s32) = G_TRUNC %0(s64)456 %3:_(s32) = G_TRUNC %1(s64)457 %4:_(s32) = G_UREM %2, %3458 %5:_(s64) = G_ANYEXT %4(s32)459 $x10 = COPY %5(s64)460 PseudoRET implicit $x10461 462...463---464name: urem_i64465body: |466 bb.0.entry:467 ; CHECK-I-LABEL: name: urem_i64468 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10469 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11470 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2471 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)472 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)473 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10474 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2475 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10476 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)477 ; CHECK-I-NEXT: PseudoRET implicit $x10478 ;479 ; CHECK-M-LABEL: name: urem_i64480 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10481 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11482 ; CHECK-M-NEXT: [[UREM:%[0-9]+]]:_(s64) = G_UREM [[COPY]], [[COPY1]]483 ; CHECK-M-NEXT: $x10 = COPY [[UREM]](s64)484 ; CHECK-M-NEXT: PseudoRET implicit $x10485 %0:_(s64) = COPY $x10486 %1:_(s64) = COPY $x11487 %2:_(s64) = G_UREM %0, %1488 $x10 = COPY %2(s64)489 PseudoRET implicit $x10490 491...492---493name: urem_i72494body: |495 bb.0.entry:496 ; CHECK-I-LABEL: name: urem_i72497 ; CHECK-I: %xlo:_(s64) = COPY $x10498 ; CHECK-I-NEXT: %xhi:_(s64) = COPY $x11499 ; CHECK-I-NEXT: %ylo:_(s64) = COPY $x12500 ; CHECK-I-NEXT: %yhi:_(s64) = COPY $x13501 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1502 ; CHECK-I-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 255503 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %xlo, [[C]]504 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %xhi, [[C1]]505 ; CHECK-I-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND %ylo, [[C]]506 ; CHECK-I-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND %yhi, [[C1]]507 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2508 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)509 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)510 ; CHECK-I-NEXT: $x12 = COPY [[AND2]](s64)511 ; CHECK-I-NEXT: $x13 = COPY [[AND3]](s64)512 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umodti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11513 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2514 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10515 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11516 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)517 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)518 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11519 ;520 ; CHECK-M-LABEL: name: urem_i72521 ; CHECK-M: %xlo:_(s64) = COPY $x10522 ; CHECK-M-NEXT: %xhi:_(s64) = COPY $x11523 ; CHECK-M-NEXT: %ylo:_(s64) = COPY $x12524 ; CHECK-M-NEXT: %yhi:_(s64) = COPY $x13525 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1526 ; CHECK-M-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 255527 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %xlo, [[C]]528 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %xhi, [[C1]]529 ; CHECK-M-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND %ylo, [[C]]530 ; CHECK-M-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND %yhi, [[C1]]531 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2532 ; CHECK-M-NEXT: $x10 = COPY [[AND]](s64)533 ; CHECK-M-NEXT: $x11 = COPY [[AND1]](s64)534 ; CHECK-M-NEXT: $x12 = COPY [[AND2]](s64)535 ; CHECK-M-NEXT: $x13 = COPY [[AND3]](s64)536 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__umodti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11537 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2538 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10539 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11540 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)541 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)542 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11543 %xlo:_(s64) = COPY $x10544 %xhi:_(s64) = COPY $x11545 %ylo:_(s64) = COPY $x12546 %yhi:_(s64) = COPY $x13547 %x0:_(s128) = G_MERGE_VALUES %xlo(s64), %xhi(s64)548 %y0:_(s128) = G_MERGE_VALUES %ylo(s64), %yhi(s64)549 %x:_(s72) = G_TRUNC %x0550 %y:_(s72) = G_TRUNC %y0551 %z:_(s72) = G_UREM %x, %y552 %z0:_(s128) = G_ANYEXT %z553 %zlo:_(s64), %zhi:_(s64) = G_UNMERGE_VALUES %z0(s128)554 $x10 = COPY %zlo(s64)555 $x11 = COPY %zhi(s64)556 PseudoRET implicit $x10, implicit $x11557 558...559---560name: urem_i128561body: |562 bb.0.entry:563 ; CHECK-I-LABEL: name: urem_i128564 ; CHECK-I: %lo1:_(s64) = COPY $x10565 ; CHECK-I-NEXT: %hi1:_(s64) = COPY $x11566 ; CHECK-I-NEXT: %lo2:_(s64) = COPY $x12567 ; CHECK-I-NEXT: %hi2:_(s64) = COPY $x13568 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2569 ; CHECK-I-NEXT: $x10 = COPY %lo1(s64)570 ; CHECK-I-NEXT: $x11 = COPY %hi1(s64)571 ; CHECK-I-NEXT: $x12 = COPY %lo2(s64)572 ; CHECK-I-NEXT: $x13 = COPY %hi2(s64)573 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umodti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11574 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2575 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10576 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11577 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)578 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)579 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11580 ;581 ; CHECK-M-LABEL: name: urem_i128582 ; CHECK-M: %lo1:_(s64) = COPY $x10583 ; CHECK-M-NEXT: %hi1:_(s64) = COPY $x11584 ; CHECK-M-NEXT: %lo2:_(s64) = COPY $x12585 ; CHECK-M-NEXT: %hi2:_(s64) = COPY $x13586 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2587 ; CHECK-M-NEXT: $x10 = COPY %lo1(s64)588 ; CHECK-M-NEXT: $x11 = COPY %hi1(s64)589 ; CHECK-M-NEXT: $x12 = COPY %lo2(s64)590 ; CHECK-M-NEXT: $x13 = COPY %hi2(s64)591 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__umodti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11592 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2593 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10594 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11595 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)596 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)597 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11598 %lo1:_(s64) = COPY $x10599 %hi1:_(s64) = COPY $x11600 %lo2:_(s64) = COPY $x12601 %hi2:_(s64) = COPY $x13602 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)603 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)604 %y:_(s128) = G_UREM %x1, %x2605 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)606 $x10 = COPY %loy(s64)607 $x11 = COPY %hiy(s64)608 PseudoRET implicit $x10, implicit $x11609 610...611