1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE2
3; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,SSE,SSE3
4; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,SSE,SSSE3
5; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+sse4.1 | FileCheck %s --check-prefixes=CHECK,SSE,SSE4,SSE41
6; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE4,SSE42
7; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1
8; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2
9; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F
10; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW
11;
12; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mcpu=slm | FileCheck %s --check-prefixes=CHECK,SSE,SSE42,SLM
13; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mcpu=goldmont | FileCheck %s --check-prefixes=CHECK,SSE,SSE42,GLM
14; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -cost-model -analyze -mcpu=btver2 | FileCheck %s --check-prefixes=CHECK,AVX,BTVER2
15
16define i32 @extract_double(i32 %arg) {
17; SSE-LABEL: 'extract_double'
18; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f64_a = extractelement <2 x double> undef, i32 %arg
19; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f64_0 = extractelement <2 x double> undef, i32 0
20; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f64_1 = extractelement <2 x double> undef, i32 1
21; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f64_a = extractelement <4 x double> undef, i32 %arg
22; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f64_0 = extractelement <4 x double> undef, i32 0
23; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f64_3 = extractelement <4 x double> undef, i32 3
24; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f64_a = extractelement <8 x double> undef, i32 %arg
25; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64_0 = extractelement <8 x double> undef, i32 0
26; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f64_3 = extractelement <8 x double> undef, i32 3
27; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64_4 = extractelement <8 x double> undef, i32 4
28; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f64_7 = extractelement <8 x double> undef, i32 7
29; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
30;
31; AVX-LABEL: 'extract_double'
32; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f64_a = extractelement <2 x double> undef, i32 %arg
33; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f64_0 = extractelement <2 x double> undef, i32 0
34; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f64_1 = extractelement <2 x double> undef, i32 1
35; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f64_a = extractelement <4 x double> undef, i32 %arg
36; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f64_0 = extractelement <4 x double> undef, i32 0
37; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4f64_3 = extractelement <4 x double> undef, i32 3
38; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f64_a = extractelement <8 x double> undef, i32 %arg
39; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64_0 = extractelement <8 x double> undef, i32 0
40; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f64_3 = extractelement <8 x double> undef, i32 3
41; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64_4 = extractelement <8 x double> undef, i32 4
42; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f64_7 = extractelement <8 x double> undef, i32 7
43; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
44;
45; AVX512-LABEL: 'extract_double'
46; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f64_a = extractelement <2 x double> undef, i32 %arg
47; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f64_0 = extractelement <2 x double> undef, i32 0
48; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f64_1 = extractelement <2 x double> undef, i32 1
49; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f64_a = extractelement <4 x double> undef, i32 %arg
50; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f64_0 = extractelement <4 x double> undef, i32 0
51; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4f64_3 = extractelement <4 x double> undef, i32 3
52; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f64_a = extractelement <8 x double> undef, i32 %arg
53; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64_0 = extractelement <8 x double> undef, i32 0
54; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f64_3 = extractelement <8 x double> undef, i32 3
55; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f64_4 = extractelement <8 x double> undef, i32 4
56; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f64_7 = extractelement <8 x double> undef, i32 7
57; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
58;
59  %v2f64_a = extractelement <2 x double> undef, i32 %arg
60  %v2f64_0 = extractelement <2 x double> undef, i32 0
61  %v2f64_1 = extractelement <2 x double> undef, i32 1
62
63  %v4f64_a = extractelement <4 x double> undef, i32 %arg
64  %v4f64_0 = extractelement <4 x double> undef, i32 0
65  %v4f64_3 = extractelement <4 x double> undef, i32 3
66
67  %v8f64_a = extractelement <8 x double> undef, i32 %arg
68  %v8f64_0 = extractelement <8 x double> undef, i32 0
69  %v8f64_3 = extractelement <8 x double> undef, i32 3
70  %v8f64_4 = extractelement <8 x double> undef, i32 4
71  %v8f64_7 = extractelement <8 x double> undef, i32 7
72
73  ret i32 undef
74}
75
76define i32 @extract_float(i32 %arg) {
77; SSE-LABEL: 'extract_float'
78; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f32_a = extractelement <2 x float> undef, i32 %arg
79; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f32_0 = extractelement <2 x float> undef, i32 0
80; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f32_1 = extractelement <2 x float> undef, i32 1
81; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f32_a = extractelement <4 x float> undef, i32 %arg
82; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f32_0 = extractelement <4 x float> undef, i32 0
83; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f32_3 = extractelement <4 x float> undef, i32 3
84; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_a = extractelement <8 x float> undef, i32 %arg
85; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f32_0 = extractelement <8 x float> undef, i32 0
86; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_3 = extractelement <8 x float> undef, i32 3
87; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f32_4 = extractelement <8 x float> undef, i32 4
88; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_7 = extractelement <8 x float> undef, i32 7
89; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_a = extractelement <16 x float> undef, i32 %arg
90; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32_0 = extractelement <16 x float> undef, i32 0
91; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_3 = extractelement <16 x float> undef, i32 3
92; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32_8 = extractelement <16 x float> undef, i32 8
93; SSE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_15 = extractelement <16 x float> undef, i32 15
94; SSE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
95;
96; AVX-LABEL: 'extract_float'
97; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f32_a = extractelement <2 x float> undef, i32 %arg
98; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f32_0 = extractelement <2 x float> undef, i32 0
99; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f32_1 = extractelement <2 x float> undef, i32 1
100; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f32_a = extractelement <4 x float> undef, i32 %arg
101; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f32_0 = extractelement <4 x float> undef, i32 0
102; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f32_3 = extractelement <4 x float> undef, i32 3
103; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_a = extractelement <8 x float> undef, i32 %arg
104; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f32_0 = extractelement <8 x float> undef, i32 0
105; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_3 = extractelement <8 x float> undef, i32 3
106; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_4 = extractelement <8 x float> undef, i32 4
107; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f32_7 = extractelement <8 x float> undef, i32 7
108; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_a = extractelement <16 x float> undef, i32 %arg
109; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32_0 = extractelement <16 x float> undef, i32 0
110; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_3 = extractelement <16 x float> undef, i32 3
111; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32_8 = extractelement <16 x float> undef, i32 8
112; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16f32_15 = extractelement <16 x float> undef, i32 15
113; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
114;
115; AVX512-LABEL: 'extract_float'
116; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f32_a = extractelement <2 x float> undef, i32 %arg
117; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f32_0 = extractelement <2 x float> undef, i32 0
118; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2f32_1 = extractelement <2 x float> undef, i32 1
119; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f32_a = extractelement <4 x float> undef, i32 %arg
120; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f32_0 = extractelement <4 x float> undef, i32 0
121; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4f32_3 = extractelement <4 x float> undef, i32 3
122; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_a = extractelement <8 x float> undef, i32 %arg
123; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f32_0 = extractelement <8 x float> undef, i32 0
124; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_3 = extractelement <8 x float> undef, i32 3
125; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8f32_4 = extractelement <8 x float> undef, i32 4
126; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f32_7 = extractelement <8 x float> undef, i32 7
127; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_a = extractelement <16 x float> undef, i32 %arg
128; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32_0 = extractelement <16 x float> undef, i32 0
129; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_3 = extractelement <16 x float> undef, i32 3
130; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16f32_8 = extractelement <16 x float> undef, i32 8
131; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16f32_15 = extractelement <16 x float> undef, i32 15
132; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
133;
134  %v2f32_a = extractelement <2 x float> undef, i32 %arg
135  %v2f32_0 = extractelement <2 x float> undef, i32 0
136  %v2f32_1 = extractelement <2 x float> undef, i32 1
137
138  %v4f32_a = extractelement <4 x float> undef, i32 %arg
139  %v4f32_0 = extractelement <4 x float> undef, i32 0
140  %v4f32_3 = extractelement <4 x float> undef, i32 3
141
142  %v8f32_a = extractelement <8 x float> undef, i32 %arg
143  %v8f32_0 = extractelement <8 x float> undef, i32 0
144  %v8f32_3 = extractelement <8 x float> undef, i32 3
145  %v8f32_4 = extractelement <8 x float> undef, i32 4
146  %v8f32_7 = extractelement <8 x float> undef, i32 7
147
148  %v16f32_a = extractelement <16 x float> undef, i32 %arg
149  %v16f32_0 = extractelement <16 x float> undef, i32 0
150  %v16f32_3 = extractelement <16 x float> undef, i32 3
151  %v16f32_8 = extractelement <16 x float> undef, i32 8
152  %v16f32_15 = extractelement <16 x float> undef, i32 15
153
154  ret i32 undef
155}
156
157define i32 @extract_i64(i32 %arg) {
158; SSE2-LABEL: 'extract_i64'
159; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
160; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
161; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
162; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
163; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
164; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
165; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
166; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
167; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
168; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
169; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
170; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
171;
172; SSE3-LABEL: 'extract_i64'
173; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
174; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
175; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
176; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
177; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
178; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
179; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
180; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
181; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
182; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
183; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
184; SSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
185;
186; SSSE3-LABEL: 'extract_i64'
187; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
188; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
189; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
190; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
191; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
192; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
193; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
194; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
195; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
196; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
197; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
198; SSSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
199;
200; SSE4-LABEL: 'extract_i64'
201; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
202; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
203; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
204; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
205; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
206; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
207; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
208; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
209; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
210; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
211; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
212; SSE4-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
213;
214; AVX-LABEL: 'extract_i64'
215; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
216; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
217; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
218; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
219; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
220; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
221; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
222; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
223; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
224; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
225; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
226; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
227;
228; AVX512-LABEL: 'extract_i64'
229; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
230; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
231; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
232; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
233; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
234; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
235; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
236; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
237; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
238; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
239; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
240; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
241;
242; SLM-LABEL: 'extract_i64'
243; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
244; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
245; SLM-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
246; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
247; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
248; SLM-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
249; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
250; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
251; SLM-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
252; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
253; SLM-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
254; SLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
255;
256; GLM-LABEL: 'extract_i64'
257; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_a = extractelement <2 x i64> undef, i32 %arg
258; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
259; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
260; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_a = extractelement <4 x i64> undef, i32 %arg
261; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
262; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i64_3 = extractelement <4 x i64> undef, i32 3
263; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_a = extractelement <8 x i64> undef, i32 %arg
264; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
265; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_3 = extractelement <8 x i64> undef, i32 3
266; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_4 = extractelement <8 x i64> undef, i32 4
267; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i64_7 = extractelement <8 x i64> undef, i32 7
268; GLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
269;
270  %v2i64_a = extractelement <2 x i64> undef, i32 %arg
271  %v2i64_0 = extractelement <2 x i64> undef, i32 0
272  %v2i64_1 = extractelement <2 x i64> undef, i32 1
273
274  %v4i64_a = extractelement <4 x i64> undef, i32 %arg
275  %v4i64_0 = extractelement <4 x i64> undef, i32 0
276  %v4i64_3 = extractelement <4 x i64> undef, i32 3
277
278  %v8i64_a = extractelement <8 x i64> undef, i32 %arg
279  %v8i64_0 = extractelement <8 x i64> undef, i32 0
280  %v8i64_3 = extractelement <8 x i64> undef, i32 3
281  %v8i64_4 = extractelement <8 x i64> undef, i32 4
282  %v8i64_7 = extractelement <8 x i64> undef, i32 7
283
284  ret i32 undef
285}
286
287define i32 @extract_i32(i32 %arg) {
288; SSE2-LABEL: 'extract_i32'
289; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
290; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
291; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
292; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
293; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
294; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
295; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
296; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
297; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
298; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
299; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
300; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
301; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
302; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
303; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
304; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
305; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
306;
307; SSE3-LABEL: 'extract_i32'
308; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
309; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
310; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
311; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
312; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
313; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
314; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
315; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
316; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
317; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
318; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
319; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
320; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
321; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
322; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
323; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
324; SSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
325;
326; SSSE3-LABEL: 'extract_i32'
327; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
328; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
329; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
330; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
331; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
332; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
333; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
334; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
335; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
336; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
337; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
338; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
339; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
340; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
341; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
342; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
343; SSSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
344;
345; SSE4-LABEL: 'extract_i32'
346; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
347; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
348; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
349; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
350; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
351; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
352; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
353; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
354; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
355; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
356; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
357; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
358; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
359; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
360; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
361; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
362; SSE4-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
363;
364; AVX-LABEL: 'extract_i32'
365; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
366; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
367; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
368; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
369; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
370; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
371; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
372; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
373; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
374; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
375; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
376; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
377; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
378; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
379; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
380; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
381; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
382;
383; AVX512-LABEL: 'extract_i32'
384; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
385; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
386; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
387; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
388; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
389; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
390; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
391; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
392; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
393; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
394; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
395; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
396; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
397; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
398; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
399; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
400; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
401;
402; SLM-LABEL: 'extract_i32'
403; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
404; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
405; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
406; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
407; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
408; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
409; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
410; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
411; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
412; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
413; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
414; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
415; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
416; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
417; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
418; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
419; SLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
420;
421; GLM-LABEL: 'extract_i32'
422; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_a = extractelement <2 x i32> undef, i32 %arg
423; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
424; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
425; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_a = extractelement <4 x i32> undef, i32 %arg
426; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
427; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i32_3 = extractelement <4 x i32> undef, i32 3
428; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_a = extractelement <8 x i32> undef, i32 %arg
429; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
430; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_3 = extractelement <8 x i32> undef, i32 3
431; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_4 = extractelement <8 x i32> undef, i32 4
432; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i32_7 = extractelement <8 x i32> undef, i32 7
433; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_a = extractelement <16 x i32> undef, i32 %arg
434; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
435; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_3 = extractelement <16 x i32> undef, i32 3
436; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_8 = extractelement <16 x i32> undef, i32 8
437; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i32_15 = extractelement <16 x i32> undef, i32 15
438; GLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
439;
440  %v2i32_a = extractelement <2 x i32> undef, i32 %arg
441  %v2i32_0 = extractelement <2 x i32> undef, i32 0
442  %v2i32_1 = extractelement <2 x i32> undef, i32 1
443
444  %v4i32_a = extractelement <4 x i32> undef, i32 %arg
445  %v4i32_0 = extractelement <4 x i32> undef, i32 0
446  %v4i32_3 = extractelement <4 x i32> undef, i32 3
447
448  %v8i32_a = extractelement <8 x i32> undef, i32 %arg
449  %v8i32_0 = extractelement <8 x i32> undef, i32 0
450  %v8i32_3 = extractelement <8 x i32> undef, i32 3
451  %v8i32_4 = extractelement <8 x i32> undef, i32 4
452  %v8i32_7 = extractelement <8 x i32> undef, i32 7
453
454  %v16i32_a = extractelement <16 x i32> undef, i32 %arg
455  %v16i32_0 = extractelement <16 x i32> undef, i32 0
456  %v16i32_3 = extractelement <16 x i32> undef, i32 3
457  %v16i32_8 = extractelement <16 x i32> undef, i32 8
458  %v16i32_15 = extractelement <16 x i32> undef, i32 15
459
460  ret i32 undef
461}
462
463define i32 @extract_i16(i32 %arg) {
464; SSE2-LABEL: 'extract_i16'
465; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
466; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
467; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
468; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
469; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
470; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
471; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
472; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
473; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
474; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
475; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
476; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
477; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
478; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
479; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
480; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
481; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
482; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
483; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
484; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
485; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
486; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
487; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
488;
489; SSE3-LABEL: 'extract_i16'
490; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
491; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
492; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
493; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
494; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
495; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
496; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
497; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
498; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
499; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
500; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
501; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
502; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
503; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
504; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
505; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
506; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
507; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
508; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
509; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
510; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
511; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
512; SSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
513;
514; SSSE3-LABEL: 'extract_i16'
515; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
516; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
517; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
518; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
519; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
520; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
521; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
522; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
523; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
524; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
525; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
526; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
527; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
528; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
529; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
530; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
531; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
532; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
533; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
534; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
535; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
536; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
537; SSSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
538;
539; SSE4-LABEL: 'extract_i16'
540; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
541; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
542; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
543; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
544; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
545; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
546; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
547; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
548; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
549; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
550; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
551; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
552; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
553; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
554; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
555; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
556; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
557; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
558; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
559; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
560; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
561; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
562; SSE4-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
563;
564; AVX-LABEL: 'extract_i16'
565; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
566; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
567; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
568; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
569; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
570; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
571; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
572; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
573; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
574; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
575; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
576; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
577; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
578; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
579; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
580; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
581; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
582; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
583; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
584; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
585; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
586; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
587; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
588;
589; AVX512-LABEL: 'extract_i16'
590; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
591; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
592; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
593; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
594; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
595; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
596; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
597; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
598; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
599; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
600; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
601; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
602; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
603; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
604; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
605; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
606; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
607; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
608; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
609; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
610; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
611; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
612; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
613;
614; SLM-LABEL: 'extract_i16'
615; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
616; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
617; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
618; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
619; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
620; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
621; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
622; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
623; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
624; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
625; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
626; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
627; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
628; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
629; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
630; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
631; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
632; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
633; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
634; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
635; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
636; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
637; SLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
638;
639; GLM-LABEL: 'extract_i16'
640; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_a = extractelement <2 x i16> undef, i32 %arg
641; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
642; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
643; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_a = extractelement <4 x i16> undef, i32 %arg
644; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
645; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i16_3 = extractelement <4 x i16> undef, i32 3
646; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_a = extractelement <8 x i16> undef, i32 %arg
647; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
648; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i16_7 = extractelement <8 x i16> undef, i32 7
649; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_a = extractelement <16 x i16> undef, i32 %arg
650; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
651; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_7 = extractelement <16 x i16> undef, i32 7
652; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_8 = extractelement <16 x i16> undef, i32 8
653; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i16_15 = extractelement <16 x i16> undef, i32 15
654; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_a = extractelement <32 x i16> undef, i32 %arg
655; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
656; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_7 = extractelement <32 x i16> undef, i32 7
657; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_8 = extractelement <32 x i16> undef, i32 8
658; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_15 = extractelement <32 x i16> undef, i32 15
659; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_16 = extractelement <32 x i16> undef, i32 16
660; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_24 = extractelement <32 x i16> undef, i32 24
661; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i16_31 = extractelement <32 x i16> undef, i32 31
662; GLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
663;
664  %v2i16_a = extractelement <2 x i16> undef, i32 %arg
665  %v2i16_0 = extractelement <2 x i16> undef, i32 0
666  %v2i16_1 = extractelement <2 x i16> undef, i32 1
667
668  %v4i16_a = extractelement <4 x i16> undef, i32 %arg
669  %v4i16_0 = extractelement <4 x i16> undef, i32 0
670  %v4i16_3 = extractelement <4 x i16> undef, i32 3
671
672  %v8i16_a = extractelement <8 x i16> undef, i32 %arg
673  %v8i16_0 = extractelement <8 x i16> undef, i32 0
674  %v8i16_7 = extractelement <8 x i16> undef, i32 7
675
676  %v16i16_a = extractelement <16 x i16> undef, i32 %arg
677  %v16i16_0 = extractelement <16 x i16> undef, i32 0
678  %v16i16_7 = extractelement <16 x i16> undef, i32 7
679  %v16i16_8 = extractelement <16 x i16> undef, i32 8
680  %v16i16_15 = extractelement <16 x i16> undef, i32 15
681
682  %v32i16_a = extractelement <32 x i16> undef, i32 %arg
683  %v32i16_0 = extractelement <32 x i16> undef, i32 0
684  %v32i16_7 = extractelement <32 x i16> undef, i32 7
685  %v32i16_8 = extractelement <32 x i16> undef, i32 8
686  %v32i16_15 = extractelement <32 x i16> undef, i32 15
687  %v32i16_16 = extractelement <32 x i16> undef, i32 16
688  %v32i16_24 = extractelement <32 x i16> undef, i32 24
689  %v32i16_31 = extractelement <32 x i16> undef, i32 31
690
691  ret i32 undef
692}
693
694define i32 @extract_i8(i32 %arg) {
695; SSE2-LABEL: 'extract_i8'
696; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
697; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
698; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
699; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
700; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
701; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
702; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
703; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
704; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
705; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
706; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
707; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
708; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
709; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
710; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
711; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
712; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
713; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
714; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
715; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
716; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
717; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
718; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
719; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
720; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
721; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
722; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
723; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
724; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
725; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
726; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
727;
728; SSE3-LABEL: 'extract_i8'
729; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
730; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
731; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
732; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
733; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
734; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
735; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
736; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
737; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
738; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
739; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
740; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
741; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
742; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
743; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
744; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
745; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
746; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
747; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
748; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
749; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
750; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
751; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
752; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
753; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
754; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
755; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
756; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
757; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
758; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
759; SSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
760;
761; SSSE3-LABEL: 'extract_i8'
762; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
763; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
764; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
765; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
766; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
767; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
768; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
769; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
770; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
771; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
772; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
773; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
774; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
775; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
776; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
777; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
778; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
779; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
780; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
781; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
782; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
783; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
784; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
785; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
786; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
787; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
788; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
789; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
790; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
791; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
792; SSSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
793;
794; SSE4-LABEL: 'extract_i8'
795; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
796; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
797; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
798; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
799; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
800; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
801; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
802; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
803; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
804; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
805; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
806; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
807; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
808; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
809; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
810; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
811; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
812; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
813; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
814; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
815; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
816; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
817; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
818; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
819; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
820; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
821; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
822; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
823; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
824; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
825; SSE4-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
826;
827; AVX-LABEL: 'extract_i8'
828; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
829; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
830; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
831; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
832; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
833; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
834; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
835; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
836; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
837; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
838; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
839; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
840; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
841; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
842; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
843; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
844; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
845; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
846; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
847; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
848; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
849; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
850; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
851; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
852; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
853; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
854; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
855; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
856; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
857; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
858; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
859;
860; AVX512-LABEL: 'extract_i8'
861; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
862; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
863; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
864; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
865; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
866; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
867; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
868; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
869; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
870; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
871; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
872; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
873; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
874; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
875; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
876; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
877; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
878; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
879; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
880; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
881; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
882; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
883; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
884; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
885; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
886; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
887; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
888; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
889; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
890; AVX512-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
891; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
892;
893; SLM-LABEL: 'extract_i8'
894; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
895; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
896; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
897; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
898; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
899; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
900; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
901; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
902; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
903; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
904; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
905; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
906; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
907; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
908; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
909; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
910; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
911; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
912; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
913; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
914; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
915; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
916; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
917; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
918; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
919; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
920; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
921; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
922; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
923; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
924; SLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
925;
926; GLM-LABEL: 'extract_i8'
927; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_a = extractelement <2 x i8> undef, i32 %arg
928; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
929; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
930; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_a = extractelement <4 x i8> undef, i32 %arg
931; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
932; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i8_3 = extractelement <4 x i8> undef, i32 3
933; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_a = extractelement <8 x i8> undef, i32 %arg
934; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
935; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i8_7 = extractelement <8 x i8> undef, i32 7
936; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_a = extractelement <16 x i8> undef, i32 %arg
937; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
938; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_8 = extractelement <16 x i8> undef, i32 8
939; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i8_15 = extractelement <16 x i8> undef, i32 15
940; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_a = extractelement <32 x i8> undef, i32 %arg
941; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
942; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_7 = extractelement <32 x i8> undef, i32 7
943; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_8 = extractelement <32 x i8> undef, i32 8
944; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_15 = extractelement <32 x i8> undef, i32 15
945; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_24 = extractelement <32 x i8> undef, i32 24
946; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i8_31 = extractelement <32 x i8> undef, i32 31
947; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_a = extractelement <64 x i8> undef, i32 %arg
948; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
949; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_7 = extractelement <64 x i8> undef, i32 7
950; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_8 = extractelement <64 x i8> undef, i32 8
951; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_15 = extractelement <64 x i8> undef, i32 15
952; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_24 = extractelement <64 x i8> undef, i32 24
953; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_31 = extractelement <64 x i8> undef, i32 31
954; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_32 = extractelement <64 x i8> undef, i32 32
955; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_48 = extractelement <64 x i8> undef, i32 48
956; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i8_63 = extractelement <64 x i8> undef, i32 63
957; GLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
958;
959  %v2i8_a = extractelement <2 x i8> undef, i32 %arg
960  %v2i8_0 = extractelement <2 x i8> undef, i32 0
961  %v2i8_1 = extractelement <2 x i8> undef, i32 1
962
963  %v4i8_a = extractelement <4 x i8> undef, i32 %arg
964  %v4i8_0 = extractelement <4 x i8> undef, i32 0
965  %v4i8_3 = extractelement <4 x i8> undef, i32 3
966
967  %v8i8_a = extractelement <8 x i8> undef, i32 %arg
968  %v8i8_0 = extractelement <8 x i8> undef, i32 0
969  %v8i8_7 = extractelement <8 x i8> undef, i32 7
970
971  %v16i8_a = extractelement <16 x i8> undef, i32 %arg
972  %v16i8_0 = extractelement <16 x i8> undef, i32 0
973  %v16i8_8 = extractelement <16 x i8> undef, i32 8
974  %v16i8_15 = extractelement <16 x i8> undef, i32 15
975
976  %v32i8_a = extractelement <32 x i8> undef, i32 %arg
977  %v32i8_0 = extractelement <32 x i8> undef, i32 0
978  %v32i8_7 = extractelement <32 x i8> undef, i32 7
979  %v32i8_8 = extractelement <32 x i8> undef, i32 8
980  %v32i8_15 = extractelement <32 x i8> undef, i32 15
981  %v32i8_24 = extractelement <32 x i8> undef, i32 24
982  %v32i8_31 = extractelement <32 x i8> undef, i32 31
983
984  %v64i8_a = extractelement <64 x i8> undef, i32 %arg
985  %v64i8_0 = extractelement <64 x i8> undef, i32 0
986  %v64i8_7 = extractelement <64 x i8> undef, i32 7
987  %v64i8_8 = extractelement <64 x i8> undef, i32 8
988  %v64i8_15 = extractelement <64 x i8> undef, i32 15
989  %v64i8_24 = extractelement <64 x i8> undef, i32 24
990  %v64i8_31 = extractelement <64 x i8> undef, i32 31
991  %v64i8_32 = extractelement <64 x i8> undef, i32 32
992  %v64i8_48 = extractelement <64 x i8> undef, i32 48
993  %v64i8_63 = extractelement <64 x i8> undef, i32 63
994
995  ret i32 undef
996}
997
998define i32 @extract_i1(i32 %arg) {
999; SSE2-LABEL: 'extract_i1'
1000; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1001; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1002; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1003; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1004; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1005; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1006; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1007; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1008; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1009; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1010; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1011; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1012; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1013; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1014; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1015; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1016; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1017; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1018; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1019; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1020; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1021; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1022; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1023; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1024; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1025; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1026; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1027; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1028; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1029; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1030; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1031;
1032; SSE3-LABEL: 'extract_i1'
1033; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1034; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1035; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1036; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1037; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1038; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1039; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1040; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1041; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1042; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1043; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1044; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1045; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1046; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1047; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1048; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1049; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1050; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1051; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1052; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1053; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1054; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1055; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1056; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1057; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1058; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1059; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1060; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1061; SSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1062; SSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1063; SSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1064;
1065; SSSE3-LABEL: 'extract_i1'
1066; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1067; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1068; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1069; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1070; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1071; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1072; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1073; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1074; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1075; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1076; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1077; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1078; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1079; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1080; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1081; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1082; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1083; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1084; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1085; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1086; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1087; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1088; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1089; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1090; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1091; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1092; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1093; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1094; SSSE3-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1095; SSSE3-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1096; SSSE3-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1097;
1098; SSE4-LABEL: 'extract_i1'
1099; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1100; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1101; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1102; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1103; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1104; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1105; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1106; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1107; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1108; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1109; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1110; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1111; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1112; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1113; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1114; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1115; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1116; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1117; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1118; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1119; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1120; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1121; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1122; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1123; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1124; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1125; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1126; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1127; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1128; SSE4-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1129; SSE4-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1130;
1131; AVX-LABEL: 'extract_i1'
1132; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1133; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1134; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1135; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1136; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1137; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1138; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1139; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1140; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1141; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1142; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1143; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1144; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1145; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1146; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1147; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1148; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1149; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1150; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1151; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1152; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1153; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1154; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1155; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1156; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1157; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1158; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1159; AVX-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1160; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1161; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1162; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1163;
1164; AVX512-LABEL: 'extract_i1'
1165; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1166; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1167; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1168; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1169; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1170; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1171; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1172; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1173; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1174; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1175; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1176; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1177; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1178; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1179; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1180; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1181; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1182; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1183; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1184; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1185; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1186; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1187; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1188; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1189; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1190; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1191; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1192; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1193; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1194; AVX512-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1195; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1196;
1197; SLM-LABEL: 'extract_i1'
1198; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1199; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1200; SLM-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1201; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1202; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1203; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1204; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1205; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1206; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1207; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1208; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1209; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1210; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1211; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1212; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1213; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1214; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1215; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1216; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1217; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1218; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1219; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1220; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1221; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1222; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1223; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1224; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1225; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1226; SLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1227; SLM-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1228; SLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1229;
1230; GLM-LABEL: 'extract_i1'
1231; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1232; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
1233; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
1234; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1235; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
1236; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v4i1_2 = extractelement <4 x i1> undef, i32 2
1237; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1238; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
1239; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v8i1_4 = extractelement <8 x i1> undef, i32 4
1240; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1241; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
1242; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_8 = extractelement <16 x i1> undef, i32 8
1243; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v16i1_15 = extractelement <16 x i1> undef, i32 15
1244; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1245; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
1246; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_7 = extractelement <32 x i1> undef, i32 7
1247; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_8 = extractelement <32 x i1> undef, i32 8
1248; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_15 = extractelement <32 x i1> undef, i32 15
1249; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_24 = extractelement <32 x i1> undef, i32 24
1250; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v32i1_31 = extractelement <32 x i1> undef, i32 31
1251; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1252; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_0 = extractelement <64 x i1> undef, i32 0
1253; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_7 = extractelement <64 x i1> undef, i32 7
1254; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_8 = extractelement <64 x i1> undef, i32 8
1255; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_15 = extractelement <64 x i1> undef, i32 15
1256; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_24 = extractelement <64 x i1> undef, i32 24
1257; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_31 = extractelement <64 x i1> undef, i32 31
1258; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_32 = extractelement <64 x i1> undef, i32 32
1259; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_48 = extractelement <64 x i1> undef, i32 48
1260; GLM-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %v64i1_63 = extractelement <64 x i1> undef, i32 63
1261; GLM-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
1262;
1263  %v2i1_a = extractelement <2 x i1> undef, i32 %arg
1264  %v2i1_0 = extractelement <2 x i1> undef, i32 0
1265  %v2i1_1 = extractelement <2 x i1> undef, i32 1
1266
1267  %v4i1_a = extractelement <4 x i1> undef, i32 %arg
1268  %v4i1_0 = extractelement <4 x i1> undef, i32 0
1269  %v4i1_2 = extractelement <4 x i1> undef, i32 2
1270
1271  %v8i1_a = extractelement <8 x i1> undef, i32 %arg
1272  %v8i1_0 = extractelement <8 x i1> undef, i32 0
1273  %v8i1_4 = extractelement <8 x i1> undef, i32 4
1274
1275  %v16i1_a = extractelement <16 x i1> undef, i32 %arg
1276  %v16i1_0 = extractelement <16 x i1> undef, i32 0
1277  %v16i1_8 = extractelement <16 x i1> undef, i32 8
1278  %v16i1_15 = extractelement <16 x i1> undef, i32 15
1279
1280  %v32i1_a = extractelement <32 x i1> undef, i32 %arg
1281  %v32i1_0 = extractelement <32 x i1> undef, i32 0
1282  %v32i1_7 = extractelement <32 x i1> undef, i32 7
1283  %v32i1_8 = extractelement <32 x i1> undef, i32 8
1284  %v32i1_15 = extractelement <32 x i1> undef, i32 15
1285  %v32i1_24 = extractelement <32 x i1> undef, i32 24
1286  %v32i1_31 = extractelement <32 x i1> undef, i32 31
1287
1288  %v64i1_a = extractelement <64 x i1> undef, i32 %arg
1289  %v64i1_0 = extractelement <64 x i1> undef, i32 0
1290  %v64i1_7 = extractelement <64 x i1> undef, i32 7
1291  %v64i1_8 = extractelement <64 x i1> undef, i32 8
1292  %v64i1_15 = extractelement <64 x i1> undef, i32 15
1293  %v64i1_24 = extractelement <64 x i1> undef, i32 24
1294  %v64i1_31 = extractelement <64 x i1> undef, i32 31
1295  %v64i1_32 = extractelement <64 x i1> undef, i32 32
1296  %v64i1_48 = extractelement <64 x i1> undef, i32 48
1297  %v64i1_63 = extractelement <64 x i1> undef, i32 63
1298
1299  ret i32 undef
1300}
1301