Simon Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py |
Craig Topper | 381b4fb | 2018-12-05 07:56:50 +0000 | [diff] [blame] | 2 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 10 | |
Simon Pilgrim | 1b986b4 | 2019-11-06 17:04:07 +0000 | [diff] [blame^] | 11 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mcpu=slm | FileCheck %s --check-prefixes=SLM |
| 12 | |
Simon Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 13 | define i32 @reduce_i64(i32 %arg) { |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 14 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 21 | ; |
| 22 | ; AVX-LABEL: 'reduce_i64' |
Sander de Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 23 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 28 | ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 29 | ; |
| 30 | ; AVX512-LABEL: 'reduce_i64' |
Sander de Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 31 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 36 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 37 | ; |
Simon Pilgrim | 1b986b4 | 2019-11-06 17:04:07 +0000 | [diff] [blame^] | 38 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 46 | %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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 51 | ret i32 undef |
| 52 | } |
| 53 | |
| 54 | define i32 @reduce_i32(i32 %arg) { |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 55 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 62 | ; |
| 63 | ; AVX-LABEL: 'reduce_i32' |
Craig Topper | 8b5f2ab | 2019-08-07 16:24:26 +0000 | [diff] [blame] | 64 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 65 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 69 | ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 70 | ; |
| 71 | ; AVX512-LABEL: 'reduce_i32' |
Craig Topper | 8b5f2ab | 2019-08-07 16:24:26 +0000 | [diff] [blame] | 72 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 73 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 77 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 78 | ; |
Simon Pilgrim | 1b986b4 | 2019-11-06 17:04:07 +0000 | [diff] [blame^] | 79 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 87 | %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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 92 | ret i32 undef |
| 93 | } |
| 94 | |
| 95 | define i32 @reduce_i16(i32 %arg) { |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 96 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 104 | ; |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 105 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 113 | ; |
| 114 | ; AVX512F-LABEL: 'reduce_i16' |
Craig Topper | 8b5f2ab | 2019-08-07 16:24:26 +0000 | [diff] [blame] | 115 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 116 | ; 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 Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 118 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 121 | ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 122 | ; |
| 123 | ; AVX512BW-LABEL: 'reduce_i16' |
Craig Topper | 8b5f2ab | 2019-08-07 16:24:26 +0000 | [diff] [blame] | 124 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 125 | ; 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 Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 127 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 128 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 130 | ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 131 | ; |
| 132 | ; AVX512DQ-LABEL: 'reduce_i16' |
Craig Topper | 8b5f2ab | 2019-08-07 16:24:26 +0000 | [diff] [blame] | 133 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 134 | ; 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 Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 136 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 139 | ; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 140 | ; |
Simon Pilgrim | 1b986b4 | 2019-11-06 17:04:07 +0000 | [diff] [blame^] | 141 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 150 | %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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 156 | ret i32 undef |
| 157 | } |
| 158 | |
| 159 | define i32 @reduce_i8(i32 %arg) { |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 160 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 169 | ; |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 170 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 179 | ; |
| 180 | ; AVX512F-LABEL: 'reduce_i8' |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 181 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 188 | ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 189 | ; |
| 190 | ; AVX512BW-LABEL: 'reduce_i8' |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 191 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 196 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 198 | ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 199 | ; |
| 200 | ; AVX512DQ-LABEL: 'reduce_i8' |
Simon Pilgrim | 1b59a16 | 2019-10-12 13:21:50 +0000 | [diff] [blame] | 201 | ; 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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 208 | ; AVX512DQ-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 209 | ; |
Simon Pilgrim | 1b986b4 | 2019-11-06 17:04:07 +0000 | [diff] [blame^] | 210 | ; 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 Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 220 | %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 Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 227 | ret i32 undef |
| 228 | } |
| 229 | |
Sander de Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 230 | declare i64 @llvm.experimental.vector.reduce.add.v1i64(<1 x i64>) |
| 231 | declare i64 @llvm.experimental.vector.reduce.add.v2i64(<2 x i64>) |
| 232 | declare i64 @llvm.experimental.vector.reduce.add.v4i64(<4 x i64>) |
| 233 | declare i64 @llvm.experimental.vector.reduce.add.v8i64(<8 x i64>) |
| 234 | declare i64 @llvm.experimental.vector.reduce.add.v16i64(<16 x i64>) |
Simon Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 235 | |
Sander de Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 236 | declare i32 @llvm.experimental.vector.reduce.add.v2i32(<2 x i32>) |
| 237 | declare i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32>) |
| 238 | declare i32 @llvm.experimental.vector.reduce.add.v8i32(<8 x i32>) |
| 239 | declare i32 @llvm.experimental.vector.reduce.add.v16i32(<16 x i32>) |
| 240 | declare i32 @llvm.experimental.vector.reduce.add.v32i32(<32 x i32>) |
Simon Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 241 | |
Sander de Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 242 | declare i16 @llvm.experimental.vector.reduce.add.v2i16(<2 x i16>) |
| 243 | declare i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16>) |
| 244 | declare i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16>) |
| 245 | declare i16 @llvm.experimental.vector.reduce.add.v16i16(<16 x i16>) |
| 246 | declare i16 @llvm.experimental.vector.reduce.add.v32i16(<32 x i16>) |
| 247 | declare i16 @llvm.experimental.vector.reduce.add.v64i16(<64 x i16>) |
Simon Pilgrim | e612ab0 | 2018-10-20 14:29:59 +0000 | [diff] [blame] | 248 | |
Sander de Smalen | 51c2fa0 | 2019-06-13 09:37:38 +0000 | [diff] [blame] | 249 | declare i8 @llvm.experimental.vector.reduce.add.v2i8(<2 x i8>) |
| 250 | declare i8 @llvm.experimental.vector.reduce.add.v4i8(<4 x i8>) |
| 251 | declare i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8>) |
| 252 | declare i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8>) |
| 253 | declare i8 @llvm.experimental.vector.reduce.add.v32i8(<32 x i8>) |
| 254 | declare i8 @llvm.experimental.vector.reduce.add.v64i8(<64 x i8>) |
| 255 | declare i8 @llvm.experimental.vector.reduce.add.v128i8(<128 x i8>) |