[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / AArch64 / GlobalISel / combine-extract-vec-elt.mir
bloba3c5fe611b41f7f8276af6fe2e94e596d85280a5
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - -march=aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s | FileCheck %s
3 ---
4 name:            extract_from_build_vector
5 alignment:       4
6 tracksRegLiveness: true
7 liveins:
8   - { reg: '$x0' }
9   - { reg: '$x1' }
10 frameInfo:
11   maxAlignment:    1
12   maxCallFrameSize: 0
13 machineFunctionInfo: {}
14 body:             |
15   bb.0:
16     liveins: $x0, $x1
18     ; CHECK-LABEL: name: extract_from_build_vector
19     ; CHECK: liveins: $x0, $x1
20     ; CHECK: %arg1:_(s64) = COPY $x0
21     ; CHECK: $x0 = COPY %arg1(s64)
22     ; CHECK: RET_ReallyLR implicit $x0
23     %arg1:_(s64) = COPY $x0
24     %arg2:_(s64) = COPY $x1
25     %zero:_(s32) = G_CONSTANT i32 0
26     %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
27     %extract:_(s64) = G_EXTRACT_VECTOR_ELT %bv(<2 x s64>), %zero(s32)
28     $x0 = COPY %extract(s64)
29     RET_ReallyLR implicit $x0
31 ...
32 ---
33 name:            extract_from_build_vector_idx1
34 alignment:       4
35 tracksRegLiveness: true
36 liveins:
37   - { reg: '$x0' }
38   - { reg: '$x1' }
39 frameInfo:
40   maxAlignment:    1
41   maxCallFrameSize: 0
42 machineFunctionInfo: {}
43 body:             |
44   bb.0:
45     liveins: $x0, $x1
47     ; CHECK-LABEL: name: extract_from_build_vector_idx1
48     ; CHECK: liveins: $x0, $x1
49     ; CHECK: %arg2:_(s64) = COPY $x1
50     ; CHECK: $x0 = COPY %arg2(s64)
51     ; CHECK: RET_ReallyLR implicit $x0
52     %arg1:_(s64) = COPY $x0
53     %arg2:_(s64) = COPY $x1
54     %one:_(s32) = G_CONSTANT i32 1
55     %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
56     %extract:_(s64) = G_EXTRACT_VECTOR_ELT %bv(<2 x s64>), %one(s32)
57     $x0 = COPY %extract(s64)
58     RET_ReallyLR implicit $x0
60 ...
61 ---
62 name:            extract_from_build_vector_idx_invalid
63 alignment:       4
64 tracksRegLiveness: true
65 liveins:
66   - { reg: '$x0' }
67   - { reg: '$x1' }
68 frameInfo:
69   maxAlignment:    1
70   maxCallFrameSize: 0
71 machineFunctionInfo: {}
72 body:             |
73   bb.0:
74     liveins: $x0, $x1
76     ; CHECK-LABEL: name: extract_from_build_vector_idx_invalid
77     ; CHECK: liveins: $x0, $x1
78     ; CHECK: %arg1:_(s64) = COPY $x0
79     ; CHECK: %arg2:_(s64) = COPY $x1
80     ; CHECK: %idx:_(s32) = G_CONSTANT i32 4
81     ; CHECK: %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
82     ; CHECK: %extract:_(s64) = G_EXTRACT_VECTOR_ELT %bv(<2 x s64>), %idx(s32)
83     ; CHECK: $x0 = COPY %extract(s64)
84     ; CHECK: RET_ReallyLR implicit $x0
85     %arg1:_(s64) = COPY $x0
86     %arg2:_(s64) = COPY $x1
87     %idx:_(s32) = G_CONSTANT i32 4
88     %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
89     %extract:_(s64) = G_EXTRACT_VECTOR_ELT %bv(<2 x s64>), %idx(s32)
90     $x0 = COPY %extract(s64)
91     RET_ReallyLR implicit $x0
93 ...
94 ---
95 name:            extract_from_build_vector_trunc
96 alignment:       4
97 tracksRegLiveness: true
98 liveins:
99   - { reg: '$x0' }
100   - { reg: '$x1' }
101 frameInfo:
102   maxAlignment:    1
103   maxCallFrameSize: 0
104 machineFunctionInfo: {}
105 body:             |
106   bb.0:
107     liveins: $x0, $x1
109     ; CHECK-LABEL: name: extract_from_build_vector_trunc
110     ; CHECK: liveins: $x0, $x1
111     ; CHECK: %arg1:_(s64) = COPY $x0
112     ; CHECK: %extract:_(s32) = G_TRUNC %arg1(s64)
113     ; CHECK: $w0 = COPY %extract(s32)
114     ; CHECK: RET_ReallyLR implicit $w0
115     %arg1:_(s64) = COPY $x0
116     %arg2:_(s64) = COPY $x1
117     %zero:_(s32) = G_CONSTANT i32 0
118     %bv:_(<2 x s32>) = G_BUILD_VECTOR_TRUNC %arg1(s64), %arg2(s64)
119     %extract:_(s32) = G_EXTRACT_VECTOR_ELT %bv(<2 x s32>), %zero(s32)
120     $w0 = COPY %extract(s32)
121     RET_ReallyLR implicit $w0
125 name:            extract_from_build_vector_multiple_uses
126 alignment:       4
127 tracksRegLiveness: true
128 liveins:
129   - { reg: '$x0' }
130   - { reg: '$x1' }
131 frameInfo:
132   maxAlignment:    1
133   maxCallFrameSize: 0
134 machineFunctionInfo: {}
135 body:             |
136   bb.0:
137     liveins: $x0, $x1
139     ; CHECK-LABEL: name: extract_from_build_vector_multiple_uses
140     ; CHECK: liveins: $x0, $x1
141     ; CHECK: %arg1:_(s64) = COPY $x0
142     ; CHECK: %arg2:_(s64) = COPY $x1
143     ; CHECK: %zero:_(s32) = G_CONSTANT i32 0
144     ; CHECK: %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
145     ; CHECK: %extract:_(s64) = G_EXTRACT_VECTOR_ELT %bv(<2 x s64>), %zero(s32)
146     ; CHECK: $x0 = COPY %extract(s64)
147     ; CHECK: $q0 = COPY %bv(<2 x s64>)
148     ; CHECK: RET_ReallyLR implicit $x0
149     %arg1:_(s64) = COPY $x0
150     %arg2:_(s64) = COPY $x1
151     %zero:_(s32) = G_CONSTANT i32 0
152     %bv:_(<2 x s64>) = G_BUILD_VECTOR %arg1(s64), %arg2(s64)
153     %extract:_(s64) = G_EXTRACT_VECTOR_ELT %bv(<2 x s64>), %zero(s32)
154     $x0 = COPY %extract(s64)
155     $q0 = COPY %bv(<2 x s64>)
156     RET_ReallyLR implicit $x0
160 name:            extract_from_insert
161 alignment:       4
162 tracksRegLiveness: true
163 liveins:
164   - { reg: '$x0' }
165   - { reg: '$x1' }
166 frameInfo:
167   maxAlignment:    1
168 body:             |
169   bb.1:
170     liveins: $x0, $x1
171     ; This test checks that this combine runs after the insertvec->build_vector
172     ; combine.
173     ; CHECK-LABEL: name: extract_from_insert
174     ; CHECK: liveins: $x0, $x1
175     ; CHECK: %arg1:_(s64) = COPY $x0
176     ; CHECK: $x0 = COPY %arg1(s64)
177     ; CHECK: RET_ReallyLR implicit $x0
178     %arg1:_(s64) = COPY $x0
179     %arg2:_(s64) = COPY $x1
180     %undef:_(<2 x s64>) = G_IMPLICIT_DEF
181     %zero:_(s32) = G_CONSTANT i32 0
182     %one:_(s32) = G_CONSTANT i32 1
183     %ins1:_(<2 x s64>) = G_INSERT_VECTOR_ELT %undef, %arg1(s64), %zero(s32)
184     %ins2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %ins1, %arg2(s64), %one(s32)
185     %extract:_(s64) = G_EXTRACT_VECTOR_ELT %ins2(<2 x s64>), %zero(s32)
186     $x0 = COPY %extract(s64)
187     RET_ReallyLR implicit $x0