1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-linux-gnu -O0 -run-pass=legalizer %s -o - | FileCheck %s
10 ; Low part of extraction takes entirity of the low register entirely, so
11 ; value stored is forwarded directly from first load.
13 ; CHECK-LABEL: name: test_extracts_1
14 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
15 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
16 ; CHECK: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
17 ; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[COPY2]](p0) :: (load 8, align 16)
18 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
19 ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_GEP [[COPY2]], [[C]](s64)
20 ; CHECK: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[GEP]](p0) :: (load 8)
21 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY [[LOAD]](s64)
22 ; CHECK: G_STORE [[COPY3]](s64), [[COPY2]](p0) :: (store 8)
27 %3:_(s128) = G_LOAD %2(p0) :: (load 16)
28 %4:_(s64) = G_EXTRACT %3(s128), 0
29 G_STORE %4(s64), %2(p0) :: (store 8)
39 ; Low extraction wipes takes whole low register. High extraction is real.
40 ; CHECK-LABEL: name: test_extracts_2
41 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
42 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
43 ; CHECK: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
44 ; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[COPY2]](p0) :: (load 8, align 16)
45 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
46 ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_GEP [[COPY2]], [[C]](s64)
47 ; CHECK: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[GEP]](p0) :: (load 8)
48 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY [[LOAD]](s64)
49 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[LOAD1]](s64), 0
50 ; CHECK: G_STORE [[COPY3]](s64), [[COPY2]](p0) :: (store 8)
51 ; CHECK: G_STORE [[EXTRACT]](s32), [[COPY2]](p0) :: (store 4)
56 %3:_(s128) = G_LOAD %2(p0) :: (load 16)
57 %4:_(s64) = G_EXTRACT %3(s128), 0
58 %5:_(s32) = G_EXTRACT %3(s128), 64
59 G_STORE %4(s64), %2(p0) :: (store 8)
60 G_STORE %5(s32), %2(p0) :: (store 4)
68 liveins: $x0, $x1, $x2
71 ; CHECK-LABEL: name: test_extracts_3
72 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
73 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
74 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 32
75 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY1]](s64), 0
76 ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[EXTRACT]](s32), [[EXTRACT1]](s32)
77 ; CHECK: $x0 = COPY [[MV]](s64)
81 %2:_(s128) = G_MERGE_VALUES %0, %1
82 %3:_(s64) = G_EXTRACT %2, 32
91 liveins: $x0, $x1, $x2
94 ; CHECK-LABEL: name: test_extracts_4
95 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
96 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
97 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 32
98 ; CHECK: $w0 = COPY [[EXTRACT]](s32)
102 %2:_(s128) = G_MERGE_VALUES %0, %1
103 %3:_(s32) = G_EXTRACT %2, 32