brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.6 KiB · 04a6aa0 Raw
231 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mattr=+m -mtriple=riscv32 -run-pass=legalizer %s -o - \3# RUN: | FileCheck %s4# RUN: llc -mattr=+zmmul -mtriple=riscv32 -run-pass=legalizer %s -o - \5# RUN: | FileCheck %s6---7name:            mul_i78body:             |9  bb.0.entry:10    ; CHECK-LABEL: name: mul_i711    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1012    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1113    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]14    ; CHECK-NEXT: $x10 = COPY [[MUL]](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_MUL %2, %321    %5:_(s32) = G_ANYEXT %4(s7)22    $x10 = COPY %5(s32)23    PseudoRET implicit $x1024 25...26---27name:            mul_i828body:             |29  bb.0.entry:30    ; CHECK-LABEL: name: mul_i831    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1032    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1133    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]34    ; CHECK-NEXT: $x10 = COPY [[MUL]](s32)35    ; CHECK-NEXT: PseudoRET implicit $x1036    %0:_(s32) = COPY $x1037    %1:_(s32) = COPY $x1138    %2:_(s8) = G_TRUNC %0(s32)39    %3:_(s8) = G_TRUNC %1(s32)40    %4:_(s8) = G_MUL %2, %341    %5:_(s32) = G_ANYEXT %4(s8)42    $x10 = COPY %5(s32)43    PseudoRET implicit $x1044 45...46---47name:            mul_i1648body:             |49  bb.0.entry:50    ; CHECK-LABEL: name: mul_i1651    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1052    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1153    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]54    ; CHECK-NEXT: $x10 = COPY [[MUL]](s32)55    ; CHECK-NEXT: PseudoRET implicit $x1056    %0:_(s32) = COPY $x1057    %1:_(s32) = COPY $x1158    %2:_(s16) = G_TRUNC %0(s32)59    %3:_(s16) = G_TRUNC %1(s32)60    %4:_(s16) = G_MUL %2, %361    %5:_(s32) = G_ANYEXT %4(s16)62    $x10 = COPY %5(s32)63    PseudoRET implicit $x1064 65...66---67name:            mul_i3268body:             |69  bb.0.entry:70    ; CHECK-LABEL: name: mul_i3271    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x1072    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x1173    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]74    ; CHECK-NEXT: $x10 = COPY [[MUL]](s32)75    ; CHECK-NEXT: PseudoRET implicit $x1076    %0:_(s32) = COPY $x1077    %1:_(s32) = COPY $x1178    %2:_(s32) = G_MUL %0, %179    $x10 = COPY %2(s32)80    PseudoRET implicit $x1081 82...83---84name:            mul_i4885body:             |86  bb.0.entry:87    ; CHECK-LABEL: name: mul_i4888    ; CHECK: %xlo:_(s32) = COPY $x1089    ; CHECK-NEXT: %xhi:_(s32) = COPY $x1190    ; CHECK-NEXT: %ylo:_(s32) = COPY $x1291    ; CHECK-NEXT: %yhi:_(s32) = COPY $x1392    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL %xlo, %ylo93    ; CHECK-NEXT: [[MUL1:%[0-9]+]]:_(s32) = G_MUL %xhi, %ylo94    ; CHECK-NEXT: [[MUL2:%[0-9]+]]:_(s32) = G_MUL %xlo, %yhi95    ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH %xlo, %ylo96    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]97    ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]98    ; CHECK-NEXT: $x10 = COPY [[MUL]](s32)99    ; CHECK-NEXT: $x11 = COPY [[ADD1]](s32)100    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11101    %xlo:_(s32) = COPY $x10102    %xhi:_(s32) = COPY $x11103    %ylo:_(s32) = COPY $x12104    %yhi:_(s32) = COPY $x13105    %x0:_(s64) = G_MERGE_VALUES %xlo(s32), %xhi(s32)106    %y0:_(s64) = G_MERGE_VALUES %ylo(s32), %yhi(s32)107    %x:_(s48) = G_TRUNC %x0(s64)108    %y:_(s48) = G_TRUNC %y0(s64)109    %z:_(s48) = G_MUL %x, %y110    %z0:_(s64) = G_ANYEXT %z(s48)111    %zlo:_(s32), %zhi:_(s32) = G_UNMERGE_VALUES %z0(s64)112    $x10 = COPY %zlo(s32)113    $x11 = COPY %zhi(s32)114    PseudoRET implicit $x10, implicit $x11115 116...117---118name:            mul_i64119body:             |120  bb.0.entry:121    ; CHECK-LABEL: name: mul_i64122    ; CHECK: %lo1:_(s32) = COPY $x10123    ; CHECK-NEXT: %hi1:_(s32) = COPY $x11124    ; CHECK-NEXT: %lo2:_(s32) = COPY $x12125    ; CHECK-NEXT: %hi2:_(s32) = COPY $x13126    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL %lo1, %lo2127    ; CHECK-NEXT: [[MUL1:%[0-9]+]]:_(s32) = G_MUL %hi1, %lo2128    ; CHECK-NEXT: [[MUL2:%[0-9]+]]:_(s32) = G_MUL %lo1, %hi2129    ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH %lo1, %lo2130    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]131    ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]132    ; CHECK-NEXT: $x10 = COPY [[MUL]](s32)133    ; CHECK-NEXT: $x11 = COPY [[ADD1]](s32)134    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11135    %lo1:_(s32) = COPY $x10136    %hi1:_(s32) = COPY $x11137    %lo2:_(s32) = COPY $x12138    %hi2:_(s32) = COPY $x13139    %x1:_(s64) = G_MERGE_VALUES %lo1(s32), %hi1(s32)140    %x2:_(s64) = G_MERGE_VALUES %lo2(s32), %hi2(s32)141    %y:_(s64) = G_MUL %x1, %x2142    %loy:_(s32), %hiy:_(s32) = G_UNMERGE_VALUES %y(s64)143    $x10 = COPY %loy(s32)144    $x11 = COPY %hiy(s32)145    PseudoRET implicit $x10, implicit $x11146 147...148---149name:            mul_i96150body:             |151  bb.0.entry:152    ; CHECK-LABEL: name: mul_i96153    ; CHECK: %lo1:_(s32) = COPY $x10154    ; CHECK-NEXT: %mid1:_(s32) = COPY $x11155    ; CHECK-NEXT: %hi1:_(s32) = COPY $x12156    ; CHECK-NEXT: %lo2:_(s32) = COPY $x13157    ; CHECK-NEXT: %mid2:_(s32) = COPY $x14158    ; CHECK-NEXT: %hi2:_(s32) = COPY $x15159    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL %lo1, %lo2160    ; CHECK-NEXT: [[MUL1:%[0-9]+]]:_(s32) = G_MUL %mid1, %lo2161    ; CHECK-NEXT: [[MUL2:%[0-9]+]]:_(s32) = G_MUL %lo1, %mid2162    ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH %lo1, %lo2163    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]164    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[MUL2]]165    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)166    ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[UMULH]]167    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD1]](s32), [[UMULH]]168    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ADD1]](s32)169    ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ICMP]], [[ICMP1]]170    ; CHECK-NEXT: [[MUL3:%[0-9]+]]:_(s32) = G_MUL %hi1, %lo2171    ; CHECK-NEXT: [[MUL4:%[0-9]+]]:_(s32) = G_MUL %mid1, %mid2172    ; CHECK-NEXT: [[MUL5:%[0-9]+]]:_(s32) = G_MUL %lo1, %hi2173    ; CHECK-NEXT: [[UMULH1:%[0-9]+]]:_(s32) = G_UMULH %mid1, %lo2174    ; CHECK-NEXT: [[UMULH2:%[0-9]+]]:_(s32) = G_UMULH %lo1, %mid2175    ; CHECK-NEXT: [[ADD3:%[0-9]+]]:_(s32) = G_ADD [[MUL3]], [[MUL4]]176    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD3]](s32)177    ; CHECK-NEXT: [[ADD4:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[MUL5]]178    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ADD4]](s32)179    ; CHECK-NEXT: [[ADD5:%[0-9]+]]:_(s32) = G_ADD [[COPY3]], [[UMULH1]]180    ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD5]](s32)181    ; CHECK-NEXT: [[ADD6:%[0-9]+]]:_(s32) = G_ADD [[COPY4]], [[UMULH2]]182    ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD6]](s32)183    ; CHECK-NEXT: [[ADD7:%[0-9]+]]:_(s32) = G_ADD [[COPY5]], [[ADD2]]184    ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ADD7]](s32)185    ; CHECK-NEXT: $x10 = COPY [[MUL]](s32)186    ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)187    ; CHECK-NEXT: $x12 = COPY [[COPY6]](s32)188    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12189    %lo1:_(s32) = COPY $x10190    %mid1:_(s32) = COPY $x11191    %hi1:_(s32) = COPY $x12192    %lo2:_(s32) = COPY $x13193    %mid2:_(s32) = COPY $x14194    %hi2:_(s32) = COPY $x15195    %x1:_(s96) = G_MERGE_VALUES %lo1(s32), %mid1(s32), %hi1(s32)196    %x2:_(s96) = G_MERGE_VALUES %lo2(s32), %mid2(s32), %hi2(s32)197    %y:_(s96) = G_MUL %x1, %x2198    %lo:_(s32), %mid:_(s32), %hi:_(s32) = G_UNMERGE_VALUES %y(s96)199    $x10 = COPY %lo(s32)200    $x11 = COPY %mid(s32)201    $x12 = COPY %hi(s32)202    PseudoRET implicit $x10, implicit $x11, implicit $x12203 204...205---206name:            smulh_i16207body:             |208  bb.0.entry:209    ; CHECK-LABEL: name: smulh_i16210    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10211    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11212    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16213    ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)214    ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)215    ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)216    ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C]](s32)217    ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[ASHR]], [[ASHR1]]218    ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[MUL]], [[C]](s32)219    ; CHECK-NEXT: $x10 = COPY [[ASHR2]](s32)220    ; CHECK-NEXT: PseudoRET implicit $x10221    %0:_(s32) = COPY $x10222    %1:_(s32) = COPY $x11223    %2:_(s16) = G_TRUNC %0(s32)224    %3:_(s16) = G_TRUNC %1(s32)225    %4:_(s16) = G_SMULH %2, %3226    %5:_(s32) = G_ANYEXT %4(s16)227    $x10 = COPY %5(s32)228    PseudoRET implicit $x10229 230...231