1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: merge_i32
10 ; CHECK: liveins: $x10
12 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
13 ; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 16
14 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
15 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[ASSERT_ZEXT]], [[C]](s64)
16 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ASSERT_ZEXT]], [[SHL]]
17 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
18 ; CHECK-NEXT: PseudoRET implicit $x10
20 %1:_(s64) = G_ASSERT_ZEXT %0, 16
21 %2:_(s16) = G_TRUNC %1(s64)
22 %3:_(s32) = G_MERGE_VALUES %2(s16), %2(s16)
23 %4:_(s64) = G_ZEXT %3(s32)
25 PseudoRET implicit $x10
32 ; CHECK-LABEL: name: merge_i64
33 ; CHECK: liveins: $x10
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
36 ; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 32
37 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
38 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[ASSERT_ZEXT]], [[C]](s64)
39 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ASSERT_ZEXT]], [[SHL]]
40 ; CHECK-NEXT: $x10 = COPY [[OR]](s64)
41 ; CHECK-NEXT: PseudoRET implicit $x10
43 %1:_(s64) = G_ASSERT_ZEXT %0, 32
44 %2:_(s32) = G_TRUNC %1(s64)
45 %3:_(s64) = G_MERGE_VALUES %2(s32), %2(s32)
47 PseudoRET implicit $x10
54 ; CHECK-LABEL: name: merge_i128
55 ; CHECK: liveins: $x10
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
58 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)
59 ; CHECK-NEXT: PseudoRET implicit $x10
61 %1:_(s128) = G_MERGE_VALUES %0(s64), %0(s64)
62 %2:_(s64) = G_TRUNC %1(s128)
64 PseudoRET implicit $x10
71 ; CHECK-LABEL: name: unmerge_i32
72 ; CHECK: liveins: $x10
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
75 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
76 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
77 ; CHECK-NEXT: $x10 = COPY [[AND]](s64)
78 ; CHECK-NEXT: PseudoRET implicit $x10
80 %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0(s64)
81 %3:_(s64) = G_ZEXT %1(s32)
83 PseudoRET implicit $x10
90 ; CHECK-LABEL: name: unmerge_i64
91 ; CHECK: liveins: $x10
93 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
94 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)
95 ; CHECK-NEXT: PseudoRET implicit $x10
97 %1:_(s128) = G_ZEXT %0(s64)
98 %2:_(s64), %3:_(s64) = G_UNMERGE_VALUES %1(s128)
100 PseudoRET implicit $x10
107 ; CHECK-LABEL: name: unmerge_i128
108 ; CHECK: liveins: $x10
110 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
111 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)
112 ; CHECK-NEXT: PseudoRET implicit $x10
113 %0:_(s64) = COPY $x10
114 %1:_(s256) = G_ZEXT %0(s64)
115 %2:_(s128), %3:_(s128) = G_UNMERGE_VALUES %1(s256)
116 %4:_(s64) = G_TRUNC %2(s128)
118 PseudoRET implicit $x10