Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py |
Simon Pilgrim | fe9403d | 2020-11-10 12:48:02 +0000 | [diff] [blame] | 2 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+sse2 | FileCheck %s --check-prefixes=SSE |
| 3 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+ssse3 | FileCheck %s --check-prefixes=SSE |
| 4 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+sse4.1 | FileCheck %s --check-prefixes=SSE |
| 5 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+sse4.2 | FileCheck %s --check-prefixes=SSE |
| 6 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx | FileCheck %s --check-prefixes=AVX |
| 7 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx2 | FileCheck %s --check-prefixes=AVX |
| 8 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx512f | FileCheck %s --check-prefixes=AVX512 |
| 9 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=AVX512 |
| 10 | ; RUN: opt < %s -cost-model -mtriple=x86_64-apple-darwin -analyze -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=AVX512 |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 11 | |
| 12 | define i32 @reduce_f64(i32 %arg) { |
| 13 | ; SSE-LABEL: 'reduce_f64' |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 14 | ; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call double @llvm.vector.reduce.fmax.v1f64(<1 x double> undef) |
| 15 | ; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef) |
| 16 | ; SSE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef) |
| 17 | ; SSE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8 = call double @llvm.vector.reduce.fmax.v8f64(<8 x double> undef) |
| 18 | ; SSE-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V16 = call double @llvm.vector.reduce.fmax.v16f64(<16 x double> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 19 | ; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 20 | ; |
| 21 | ; AVX-LABEL: 'reduce_f64' |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 22 | ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call double @llvm.vector.reduce.fmax.v1f64(<1 x double> undef) |
| 23 | ; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef) |
| 24 | ; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef) |
| 25 | ; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8 = call double @llvm.vector.reduce.fmax.v8f64(<8 x double> undef) |
| 26 | ; AVX-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V16 = call double @llvm.vector.reduce.fmax.v16f64(<16 x double> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 27 | ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 28 | ; |
| 29 | ; AVX512-LABEL: 'reduce_f64' |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 30 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call double @llvm.vector.reduce.fmax.v1f64(<1 x double> undef) |
| 31 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef) |
| 32 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef) |
| 33 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V8 = call double @llvm.vector.reduce.fmax.v8f64(<8 x double> undef) |
| 34 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V16 = call double @llvm.vector.reduce.fmax.v16f64(<16 x double> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 35 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 36 | ; |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 37 | %V1 = call double @llvm.vector.reduce.fmax.v1f64(<1 x double> undef) |
| 38 | %V2 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef) |
| 39 | %V4 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef) |
| 40 | %V8 = call double @llvm.vector.reduce.fmax.v8f64(<8 x double> undef) |
| 41 | %V16 = call double @llvm.vector.reduce.fmax.v16f64(<16 x double> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 42 | ret i32 undef |
| 43 | } |
| 44 | |
| 45 | define i32 @reduce_f32(i32 %arg) { |
Craig Topper | 5625e6a | 2020-04-09 16:58:28 -0700 | [diff] [blame] | 46 | ; SSE-LABEL: 'reduce_f32' |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 47 | ; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call float @llvm.vector.reduce.fmax.v1f32(<1 x float> undef) |
| 48 | ; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call float @llvm.vector.reduce.fmax.v2f32(<2 x float> undef) |
| 49 | ; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef) |
| 50 | ; SSE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef) |
| 51 | ; SSE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V16 = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> undef) |
| 52 | ; SSE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %V32 = call float @llvm.vector.reduce.fmax.v32f32(<32 x float> undef) |
Craig Topper | 5625e6a | 2020-04-09 16:58:28 -0700 | [diff] [blame] | 53 | ; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 54 | ; |
| 55 | ; AVX-LABEL: 'reduce_f32' |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 56 | ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call float @llvm.vector.reduce.fmax.v1f32(<1 x float> undef) |
| 57 | ; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call float @llvm.vector.reduce.fmax.v2f32(<2 x float> undef) |
| 58 | ; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef) |
| 59 | ; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V8 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef) |
| 60 | ; AVX-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V16 = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> undef) |
| 61 | ; AVX-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V32 = call float @llvm.vector.reduce.fmax.v32f32(<32 x float> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 62 | ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 63 | ; |
| 64 | ; AVX512-LABEL: 'reduce_f32' |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 65 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call float @llvm.vector.reduce.fmax.v1f32(<1 x float> undef) |
| 66 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call float @llvm.vector.reduce.fmax.v2f32(<2 x float> undef) |
| 67 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef) |
| 68 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V8 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef) |
| 69 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V16 = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> undef) |
| 70 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V32 = call float @llvm.vector.reduce.fmax.v32f32(<32 x float> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 71 | ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef |
| 72 | ; |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 73 | %V1 = call float @llvm.vector.reduce.fmax.v1f32(<1 x float> undef) |
| 74 | %V2 = call float @llvm.vector.reduce.fmax.v2f32(<2 x float> undef) |
| 75 | %V4 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef) |
| 76 | %V8 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef) |
| 77 | %V16 = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> undef) |
| 78 | %V32 = call float @llvm.vector.reduce.fmax.v32f32(<32 x float> undef) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 79 | ret i32 undef |
| 80 | } |
| 81 | |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 82 | declare double @llvm.vector.reduce.fmax.v1f64(<1 x double>) |
| 83 | declare double @llvm.vector.reduce.fmax.v2f64(<2 x double>) |
| 84 | declare double @llvm.vector.reduce.fmax.v4f64(<4 x double>) |
| 85 | declare double @llvm.vector.reduce.fmax.v8f64(<8 x double>) |
| 86 | declare double @llvm.vector.reduce.fmax.v16f64(<16 x double>) |
Craig Topper | c0aa97b | 2020-03-28 15:30:13 -0700 | [diff] [blame] | 87 | |
Amara Emerson | 322d0af | 2020-10-02 18:30:53 -0700 | [diff] [blame] | 88 | declare float @llvm.vector.reduce.fmax.v1f32(<1 x float>) |
| 89 | declare float @llvm.vector.reduce.fmax.v2f32(<2 x float>) |
| 90 | declare float @llvm.vector.reduce.fmax.v4f32(<4 x float>) |
| 91 | declare float @llvm.vector.reduce.fmax.v8f32(<8 x float>) |
| 92 | declare float @llvm.vector.reduce.fmax.v16f32(<16 x float>) |
| 93 | declare float @llvm.vector.reduce.fmax.v32f32(<32 x float>) |