1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -march=aarch64 -run-pass=legalizer %s -o - | FileCheck %s
10 ; CHECK-LABEL: name: test_load
11 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
12 ; CHECK: [[LOAD:%[0-9]+]]:_(s8) = G_LOAD [[COPY]](p0) :: (load 1)
13 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD]](s8)
14 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
15 ; CHECK: [[LOAD1:%[0-9]+]]:_(s8) = G_LOAD [[COPY]](p0) :: (load 1)
16 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD1]](s8)
17 ; CHECK: $w0 = COPY [[ANYEXT1]](s32)
18 ; CHECK: [[LOAD2:%[0-9]+]]:_(s16) = G_LOAD [[COPY]](p0) :: (load 2)
19 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD2]](s16)
20 ; CHECK: $w0 = COPY [[ANYEXT2]](s32)
21 ; CHECK: $w0 = COPY [[ANYEXT1]](s32)
22 ; CHECK: [[LOAD3:%[0-9]+]]:_(s64) = G_LOAD [[COPY]](p0) :: (load 8)
23 ; CHECK: $x0 = COPY [[LOAD3]](s64)
24 ; CHECK: [[LOAD4:%[0-9]+]]:_(p0) = G_LOAD [[COPY]](p0) :: (load 8)
25 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[LOAD4]](p0)
26 ; CHECK: $x0 = COPY [[PTRTOINT]](s64)
27 ; CHECK: [[LOAD5:%[0-9]+]]:_(<2 x s32>) = G_LOAD [[COPY]](p0) :: (load 8)
28 ; CHECK: [[BITCAST:%[0-9]+]]:_(s64) = G_BITCAST [[LOAD5]](<2 x s32>)
29 ; CHECK: $x0 = COPY [[BITCAST]](s64)
30 ; CHECK: [[LOAD6:%[0-9]+]]:_(s64) = G_LOAD [[COPY]](p0) :: (load 8, align 16)
31 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
32 ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_GEP [[COPY]], [[C]](s64)
33 ; CHECK: [[LOAD7:%[0-9]+]]:_(s64) = G_LOAD [[GEP]](p0) :: (load 8)
34 ; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[LOAD6]](s64), [[LOAD7]](s64)
35 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[MV]](s128)
36 ; CHECK: $x0 = COPY [[TRUNC]](s64)
38 %1:_(s1) = G_LOAD %0(p0) :: (load 1)
39 %2:_(s32) = G_ANYEXT %1(s1)
41 %3:_(s8) = G_LOAD %0(p0) :: (load 1)
42 %4:_(s32) = G_ANYEXT %3(s8)
44 %5:_(s16) = G_LOAD %0(p0) :: (load 2)
45 %6:_(s32) = G_ANYEXT %5(s16)
47 %7:_(s32) = G_LOAD %0(p0) :: (load 4)
49 %8:_(s64) = G_LOAD %0(p0) :: (load 8)
51 %9:_(p0) = G_LOAD %0(p0) :: (load 8)
52 %10:_(s64) = G_PTRTOINT %9(p0)
54 %11:_(<2 x s32>) = G_LOAD %0(p0) :: (load 8)
55 %12:_(s64) = G_BITCAST %11(<2 x s32>)
57 %13:_(s128) = G_LOAD %0(p0) :: (load 16)
58 %14:_(s64) = G_TRUNC %13(s128)
68 ; CHECK-LABEL: name: test_store
69 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
70 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
71 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
72 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
73 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
74 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
75 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[AND]](s32)
76 ; CHECK: G_STORE [[TRUNC]](s8), [[COPY]](p0) :: (store 1)
77 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
78 ; CHECK: G_STORE [[TRUNC1]](s8), [[COPY]](p0) :: (store 1)
79 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
80 ; CHECK: G_STORE [[TRUNC2]](s16), [[COPY]](p0) :: (store 2)
81 ; CHECK: G_STORE [[COPY1]](s32), [[COPY]](p0) :: (store 4)
82 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[COPY]](p0)
83 ; CHECK: G_STORE [[PTRTOINT]](s64), [[COPY]](p0) :: (store 8)
84 ; CHECK: G_STORE [[COPY]](p0), [[COPY]](p0) :: (store 8)
85 ; CHECK: [[PTRTOINT1:%[0-9]+]]:_(s64) = G_PTRTOINT [[COPY]](p0)
86 ; CHECK: G_STORE [[PTRTOINT1]](s64), [[COPY]](p0) :: (store 8, align 16)
87 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
88 ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_GEP [[COPY]], [[C1]](s64)
89 ; CHECK: G_STORE [[PTRTOINT1]](s64), [[GEP]](p0) :: (store 8)
92 %2:_(s1) = G_TRUNC %1(s32)
93 G_STORE %2(s1), %0(p0) :: (store 1)
94 %3:_(s8) = G_TRUNC %1(s32)
95 G_STORE %3(s8), %0(p0) :: (store 1)
96 %4:_(s16) = G_TRUNC %1(s32)
97 G_STORE %4(s16), %0(p0) :: (store 2)
98 G_STORE %1(s32), %0(p0) :: (store 4)
99 %5:_(s64) = G_PTRTOINT %0(p0)
100 G_STORE %5(s64), %0(p0) :: (store 8)
101 G_STORE %0(p0), %0(p0) :: (store 8)
102 %6:_(s64) = G_PTRTOINT %0(p0)
103 %7:_(s128) = G_MERGE_VALUES %6(s64), %6
104 G_STORE %7(s128), %0(p0) :: (store 16)