205 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 %s4---5name: sub_i86body: |7 bb.0.entry:8 ; CHECK-LABEL: name: sub_i89 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1010 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1111 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[COPY1]]12 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)13 ; CHECK-NEXT: PseudoRET implicit $x1014 %0:_(s64) = COPY $x1015 %1:_(s64) = COPY $x1116 %2:_(s8) = G_TRUNC %0(s64)17 %3:_(s8) = G_TRUNC %1(s64)18 %4:_(s8) = G_SUB %2, %319 %5:_(s64) = G_ANYEXT %4(s8)20 $x10 = COPY %5(s64)21 PseudoRET implicit $x1022 23...24---25name: sub_i1526body: |27 bb.0.entry:28 ; CHECK-LABEL: name: sub_i1529 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1030 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1131 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[COPY1]]32 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)33 ; CHECK-NEXT: PseudoRET implicit $x1034 %0:_(s64) = COPY $x1035 %1:_(s64) = COPY $x1136 %2:_(s15) = G_TRUNC %0(s64)37 %3:_(s15) = G_TRUNC %1(s64)38 %4:_(s15) = G_SUB %2, %339 %5:_(s64) = G_ANYEXT %4(s15)40 $x10 = COPY %5(s64)41 PseudoRET implicit $x1042 43...44---45name: sub_i1646body: |47 bb.0.entry:48 ; CHECK-LABEL: name: sub_i1649 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1050 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1151 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[COPY1]]52 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)53 ; CHECK-NEXT: PseudoRET implicit $x1054 %0:_(s64) = COPY $x1055 %1:_(s64) = COPY $x1156 %2:_(s16) = G_TRUNC %0(s64)57 %3:_(s16) = G_TRUNC %1(s64)58 %4:_(s16) = G_SUB %2, %359 %5:_(s64) = G_ANYEXT %4(s16)60 $x10 = COPY %5(s64)61 PseudoRET implicit $x1062 63...64---65name: sub_i3266body: |67 bb.0.entry:68 ; CHECK-LABEL: name: sub_i3269 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1070 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1171 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[COPY1]]72 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 3273 ; CHECK-NEXT: $x10 = COPY [[SEXT_INREG]](s64)74 ; CHECK-NEXT: PseudoRET implicit $x1075 %0:_(s64) = COPY $x1076 %1:_(s64) = COPY $x1177 %2:_(s32) = G_TRUNC %0(s64)78 %3:_(s32) = G_TRUNC %1(s64)79 %4:_(s32) = G_SUB %2, %380 %5:_(s64) = G_ANYEXT %4(s32)81 $x10 = COPY %5(s64)82 PseudoRET implicit $x1083 84...85---86name: sub_i6487body: |88 bb.0.entry:89 ; CHECK-LABEL: name: sub_i6490 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1091 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1192 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[COPY1]]93 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)94 ; CHECK-NEXT: PseudoRET implicit $x1095 %0:_(s64) = COPY $x1096 %1:_(s64) = COPY $x1197 %2:_(s64) = G_SUB %0, %198 $x10 = COPY %2(s64)99 PseudoRET implicit $x10100 101...102---103name: sub_i72104body: |105 bb.0.entry:106 ; CHECK-LABEL: name: sub_i72107 ; CHECK: %x00:_(s64) = COPY $x10108 ; CHECK-NEXT: %x01:_(s64) = COPY $x11109 ; CHECK-NEXT: %y00:_(s64) = COPY $x12110 ; CHECK-NEXT: %y01:_(s64) = COPY $x13111 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %x00, %y00112 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), %x00(s64), %y00113 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB %x01, %y01114 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s64) = G_SUB [[SUB1]], [[ICMP]]115 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)116 ; CHECK-NEXT: $x11 = COPY [[SUB2]](s64)117 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11118 %x00:_(s64) = COPY $x10119 %x01:_(s64) = COPY $x11120 %y00:_(s64) = COPY $x12121 %y01:_(s64) = COPY $x13122 %x0:_(s128) = G_MERGE_VALUES %x00(s64), %x01123 %y0:_(s128) = G_MERGE_VALUES %y00(s64), %y01124 %x:_(s72) = G_TRUNC %x0(s128)125 %y:_(s72) = G_TRUNC %y0(s128)126 %z:_(s72) = G_SUB %x, %y127 %z0:_(s128) = G_ANYEXT %z(s72)128 %z00:_(s64), %z01:_(s64) = G_UNMERGE_VALUES %z0(s128)129 $x10 = COPY %z00(s64)130 $x11 = COPY %z01(s64)131 PseudoRET implicit $x10, implicit $x11132 133...134---135name: sub_i128136body: |137 bb.0.entry:138 ; CHECK-LABEL: name: sub_i128139 ; CHECK: %lo1:_(s64) = COPY $x10140 ; CHECK-NEXT: %hi1:_(s64) = COPY $x11141 ; CHECK-NEXT: %lo2:_(s64) = COPY $x12142 ; CHECK-NEXT: %hi2:_(s64) = COPY $x13143 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %lo1, %lo2144 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), %lo1(s64), %lo2145 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB %hi1, %hi2146 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s64) = G_SUB [[SUB1]], [[ICMP]]147 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)148 ; CHECK-NEXT: $x11 = COPY [[SUB2]](s64)149 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11150 %lo1:_(s64) = COPY $x10151 %hi1:_(s64) = COPY $x11152 %lo2:_(s64) = COPY $x12153 %hi2:_(s64) = COPY $x13154 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)155 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)156 %y:_(s128) = G_SUB %x1, %x2157 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)158 $x10 = COPY %loy(s64)159 $x11 = COPY %hiy(s64)160 PseudoRET implicit $x10, implicit $x11161 162...163---164name: sub_i192165body: |166 bb.0.entry:167 ; CHECK-LABEL: name: sub_i192168 ; CHECK: %lo1:_(s64) = COPY $x10169 ; CHECK-NEXT: %mid1:_(s64) = COPY $x11170 ; CHECK-NEXT: %hi1:_(s64) = COPY $x12171 ; CHECK-NEXT: %lo2:_(s64) = COPY $x13172 ; CHECK-NEXT: %mid2:_(s64) = COPY $x14173 ; CHECK-NEXT: %hi2:_(s64) = COPY $x15174 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %lo1, %lo2175 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), %lo1(s64), %lo2176 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB %mid1, %mid2177 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[SUB1]](s64), %mid1178 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s64) = G_SUB [[SUB1]], [[ICMP]]179 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0180 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[SUB1]](s64), [[C]]181 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ICMP2]], [[ICMP]]182 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ICMP1]], [[AND]]183 ; CHECK-NEXT: [[SUB3:%[0-9]+]]:_(s64) = G_SUB %hi1, %hi2184 ; CHECK-NEXT: [[SUB4:%[0-9]+]]:_(s64) = G_SUB [[SUB3]], [[OR]]185 ; CHECK-NEXT: $x10 = COPY [[SUB]](s64)186 ; CHECK-NEXT: $x11 = COPY [[SUB2]](s64)187 ; CHECK-NEXT: $x12 = COPY [[SUB4]](s64)188 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12189 %lo1:_(s64) = COPY $x10190 %mid1:_(s64) = COPY $x11191 %hi1:_(s64) = COPY $x12192 %lo2:_(s64) = COPY $x13193 %mid2:_(s64) = COPY $x14194 %hi2:_(s64) = COPY $x15195 %x1:_(s192) = G_MERGE_VALUES %lo1(s64), %mid1(s64), %hi1(s64)196 %x2:_(s192) = G_MERGE_VALUES %lo2(s64), %mid2(s64), %hi2(s64)197 %y:_(s192) = G_SUB %x1, %x2198 %lo:_(s64), %mid:_(s64), %hi:_(s64) = G_UNMERGE_VALUES %y(s192)199 $x10 = COPY %lo(s64)200 $x11 = COPY %mid(s64)201 $x12 = COPY %hi(s64)202 PseudoRET implicit $x10, implicit $x11, implicit $x12203 204...205