blob: 2efadd801b056ebc96774a4ccb0e3a57daaf79bb [file] [log] [blame]
Simon Pilgrime612ab02018-10-20 14:29:59 +00001; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
Craig Topper381b4fb2018-12-05 07:56:50 +00002; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE2
3; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,SSE,SSSE3
4; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE42
5; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1
6; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2
7; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F
8; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW
9; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512DQ
Simon Pilgrime612ab02018-10-20 14:29:59 +000010
Simon Pilgrim1b986b42019-11-06 17:04:07 +000011; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mcpu=slm | FileCheck %s --check-prefixes=SLM
12
Simon Pilgrime612ab02018-10-20 14:29:59 +000013define i32 @reduce_i64(i32 %arg) {
Simon Pilgrim1b59a162019-10-12 13:21:50 +000014; SSE-LABEL: 'reduce_i64'
15; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64> undef)
16; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64> undef)
17; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64> undef)
18; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V8 = call i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64> undef)
19; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V16 = call i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64> undef)
20; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
Simon Pilgrime612ab02018-10-20 14:29:59 +000021;
22; AVX-LABEL: 'reduce_i64'
Sander de Smalen51c2fa02019-06-13 09:37:38 +000023; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64> undef)
24; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2 = call i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64> undef)
25; AVX-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64> undef)
26; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V8 = call i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64> undef)
27; AVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V16 = call i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +000028; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
29;
30; AVX512-LABEL: 'reduce_i64'
Sander de Smalen51c2fa02019-06-13 09:37:38 +000031; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64> undef)
32; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2 = call i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64> undef)
33; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64> undef)
34; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V8 = call i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64> undef)
35; AVX512-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V16 = call i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +000036; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
37;
Simon Pilgrim1b986b42019-11-06 17:04:07 +000038; SLM-LABEL: 'reduce_i64'
39; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64> undef)
40; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64> undef)
41; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64> undef)
42; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V8 = call i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64> undef)
43; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V16 = call i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64> undef)
44; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
45;
Sander de Smalen51c2fa02019-06-13 09:37:38 +000046 %V1 = call i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64> undef)
47 %V2 = call i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64> undef)
48 %V4 = call i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64> undef)
49 %V8 = call i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64> undef)
50 %V16 = call i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +000051 ret i32 undef
52}
53
54define i32 @reduce_i32(i32 %arg) {
Simon Pilgrim1b59a162019-10-12 13:21:50 +000055; SSE-LABEL: 'reduce_i32'
56; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32> undef)
57; SSE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> undef)
58; SSE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V8 = call i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32> undef)
59; SSE-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V16 = call i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32> undef)
60; SSE-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %V32 = call i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32> undef)
61; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
Simon Pilgrime612ab02018-10-20 14:29:59 +000062;
63; AVX-LABEL: 'reduce_i32'
Craig Topper8b5f2ab2019-08-07 16:24:26 +000064; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +000065; AVX-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> undef)
66; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8 = call i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32> undef)
67; AVX-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V16 = call i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32> undef)
68; AVX-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %V32 = call i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +000069; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
70;
71; AVX512-LABEL: 'reduce_i32'
Craig Topper8b5f2ab2019-08-07 16:24:26 +000072; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +000073; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> undef)
74; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8 = call i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32> undef)
75; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V16 = call i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32> undef)
76; AVX512-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V32 = call i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +000077; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
78;
Simon Pilgrim1b986b42019-11-06 17:04:07 +000079; SLM-LABEL: 'reduce_i32'
80; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32> undef)
81; SLM-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> undef)
82; SLM-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V8 = call i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32> undef)
83; SLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V16 = call i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32> undef)
84; SLM-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %V32 = call i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32> undef)
85; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
86;
Sander de Smalen51c2fa02019-06-13 09:37:38 +000087 %V2 = call i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32> undef)
88 %V4 = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> undef)
89 %V8 = call i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32> undef)
90 %V16 = call i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32> undef)
91 %V32 = call i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +000092 ret i32 undef
93}
94
95define i32 @reduce_i16(i32 %arg) {
Simon Pilgrim1b59a162019-10-12 13:21:50 +000096; SSE-LABEL: 'reduce_i16'
97; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
98; SSE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
99; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
100; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
101; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
102; SSE-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
103; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
Simon Pilgrime612ab02018-10-20 14:29:59 +0000104;
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000105; AVX-LABEL: 'reduce_i16'
106; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
107; AVX-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
108; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
109; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
110; AVX-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
111; AVX-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
112; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
Simon Pilgrime612ab02018-10-20 14:29:59 +0000113;
114; AVX512F-LABEL: 'reduce_i16'
Craig Topper8b5f2ab2019-08-07 16:24:26 +0000115; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000116; AVX512F-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
117; AVX512F-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000118; AVX512F-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
119; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
120; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000121; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
122;
123; AVX512BW-LABEL: 'reduce_i16'
Craig Topper8b5f2ab2019-08-07 16:24:26 +0000124; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000125; AVX512BW-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
126; AVX512BW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000127; AVX512BW-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000128; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
129; AVX512BW-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000130; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
131;
132; AVX512DQ-LABEL: 'reduce_i16'
Craig Topper8b5f2ab2019-08-07 16:24:26 +0000133; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000134; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
135; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000136; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
137; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
138; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000139; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
140;
Simon Pilgrim1b986b42019-11-06 17:04:07 +0000141; SLM-LABEL: 'reduce_i16'
142; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
143; SLM-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
144; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
145; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
146; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
147; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
148; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
149;
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000150 %V2 = call i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16> undef)
151 %V4 = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> undef)
152 %V8 = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> undef)
153 %V16 = call i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16> undef)
154 %V32 = call i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16> undef)
155 %V64 = call i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000156 ret i32 undef
157}
158
159define i32 @reduce_i8(i32 %arg) {
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000160; SSE-LABEL: 'reduce_i8'
161; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
162; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
163; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
164; SSE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
165; SSE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
166; SSE-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
167; SSE-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
168; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
Simon Pilgrime612ab02018-10-20 14:29:59 +0000169;
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000170; AVX-LABEL: 'reduce_i8'
171; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
172; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
173; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
174; AVX-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
175; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
176; AVX-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
177; AVX-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
178; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
Simon Pilgrime612ab02018-10-20 14:29:59 +0000179;
180; AVX512F-LABEL: 'reduce_i8'
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000181; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
182; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
183; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
184; AVX512F-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
185; AVX512F-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
186; AVX512F-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
187; AVX512F-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000188; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
189;
190; AVX512BW-LABEL: 'reduce_i8'
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000191; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
192; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
193; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
194; AVX512BW-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
195; AVX512BW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000196; AVX512BW-NEXT: Cost Model: Found an estimated cost of 55 for instruction: %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
197; AVX512BW-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000198; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
199;
200; AVX512DQ-LABEL: 'reduce_i8'
Simon Pilgrim1b59a162019-10-12 13:21:50 +0000201; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
202; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
203; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
204; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
205; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
206; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
207; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000208; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
209;
Simon Pilgrim1b986b42019-11-06 17:04:07 +0000210; SLM-LABEL: 'reduce_i8'
211; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
212; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
213; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
214; SLM-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
215; SLM-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
216; SLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
217; SLM-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
218; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
219;
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000220 %V2 = call i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8> undef)
221 %V4 = call i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8> undef)
222 %V8 = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> undef)
223 %V16 = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> undef)
224 %V32 = call i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8> undef)
225 %V64 = call i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8> undef)
226 %V128 = call i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8> undef)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000227 ret i32 undef
228}
229
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000230declare i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64>)
231declare i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64>)
232declare i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64>)
233declare i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64>)
234declare i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64>)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000235
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000236declare i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32>)
237declare i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32>)
238declare i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32>)
239declare i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32>)
240declare i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32>)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000241
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000242declare i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16>)
243declare i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16>)
244declare i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16>)
245declare i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16>)
246declare i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16>)
247declare i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16>)
Simon Pilgrime612ab02018-10-20 14:29:59 +0000248
Sander de Smalen51c2fa02019-06-13 09:37:38 +0000249declare i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8>)
250declare i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8>)
251declare i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8>)
252declare i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8>)
253declare i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8>)
254declare i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8>)
255declare i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8>)