1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -O0 -run-pass=legalizer -global-isel-abort=2 %s -o - | FileCheck %s
8 ; CHECK-LABEL: name: test_merge_s4
9 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
10 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
11 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
12 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
13 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND]], [[C2]](s64)
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
15 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
16 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND1]], [[SHL]]
17 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[OR]](s32)
18 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
19 %0:_(s64) = G_CONSTANT i64 0
22 %2:_(s8) = G_MERGE_VALUES %1, %1
24 %4:_(s64) = G_ANYEXT %3
28 name: test_merge_s16_s8
32 ; This isn't legal but we don't support widening the destination type.
33 ; CHECK-LABEL: name: test_merge_s16_s8
34 ; CHECK: %a:_(s32) = COPY $w0
35 ; CHECK-NEXT: %b:_(s32) = COPY $w1
36 ; CHECK-NEXT: %a_t:_(s8) = G_TRUNC %a(s32)
37 ; CHECK-NEXT: %b_t:_(s8) = G_TRUNC %b(s32)
38 ; CHECK-NEXT: %m:_(s16) = G_MERGE_VALUES %a_t(s8), %b_t(s8)
39 ; CHECK-NEXT: %ext:_(s64) = G_ANYEXT %m(s16)
40 ; CHECK-NEXT: $x0 = COPY %ext(s64)
43 %a_t:_(s8) = G_TRUNC %a
44 %b_t:_(s8) = G_TRUNC %b
46 %m:_(s16) = G_MERGE_VALUES %a_t, %b_t
47 %ext:_(s64) = G_ANYEXT %m