1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=regbankselect \
3 # RUN: -disable-gisel-legality-check -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck -check-prefix=RV64I %s
13 ; RV64I-LABEL: name: anyext_i32_i64
14 ; RV64I: liveins: $x10, $x11
16 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
17 ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
18 ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
19 ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY1]](s64)
20 ; RV64I-NEXT: [[ADD:%[0-9]+]]:gprb(s32) = G_ADD [[TRUNC]], [[TRUNC1]]
21 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[ADD]](s32)
22 ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
23 ; RV64I-NEXT: PseudoRET implicit $x10
25 %0:_(s32) = G_TRUNC %2(s64)
27 %1:_(s32) = G_TRUNC %3(s64)
28 %4:_(s32) = G_ADD %0, %1
29 %5:_(s64) = G_ANYEXT %4(s32)
31 PseudoRET implicit $x10
41 ; RV64I-LABEL: name: sext_i32_i64
42 ; RV64I: liveins: $x10, $x11
44 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
45 ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
46 ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
47 ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY1]](s64)
48 ; RV64I-NEXT: [[ADD:%[0-9]+]]:gprb(s32) = G_ADD [[TRUNC]], [[TRUNC1]]
49 ; RV64I-NEXT: [[SEXT:%[0-9]+]]:gprb(s64) = G_SEXT [[ADD]](s32)
50 ; RV64I-NEXT: $x10 = COPY [[SEXT]](s64)
51 ; RV64I-NEXT: PseudoRET implicit $x10
53 %0:_(s32) = G_TRUNC %2(s64)
55 %1:_(s32) = G_TRUNC %3(s64)
56 %4:_(s32) = G_ADD %0, %1
57 %5:_(s64) = G_SEXT %4(s32)
59 PseudoRET implicit $x10
69 ; RV64I-LABEL: name: zext_i32_i64
70 ; RV64I: liveins: $x10, $x11
72 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
73 ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
74 ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
75 ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY1]](s64)
76 ; RV64I-NEXT: [[ADD:%[0-9]+]]:gprb(s32) = G_ADD [[TRUNC]], [[TRUNC1]]
77 ; RV64I-NEXT: [[ZEXT:%[0-9]+]]:gprb(s64) = G_ZEXT [[ADD]](s32)
78 ; RV64I-NEXT: $x10 = COPY [[ZEXT]](s64)
79 ; RV64I-NEXT: PseudoRET implicit $x10
81 %0:_(s32) = G_TRUNC %2(s64)
83 %1:_(s32) = G_TRUNC %3(s64)
84 %4:_(s32) = G_ADD %0, %1
85 %5:_(s64) = G_ZEXT %4(s32)
87 PseudoRET implicit $x10