blob: 1a1248e661c581f35b6124ab26cab3d0a7f4f1d3 [file] [log] [blame]
Tim Northover00ed9962014-03-29 10:18:08 +00001; RUN: opt < %s -cost-model -analyze -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s
2target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
3
4; CHECK-LABEL: select
5define void @select() {
6 ; Scalar values
7 ; CHECK: cost of 1 {{.*}} select
8 %v1 = select i1 undef, i8 undef, i8 undef
9 ; CHECK: cost of 1 {{.*}} select
10 %v2 = select i1 undef, i16 undef, i16 undef
11 ; CHECK: cost of 1 {{.*}} select
12 %v3 = select i1 undef, i32 undef, i32 undef
13 ; CHECK: cost of 1 {{.*}} select
14 %v4 = select i1 undef, i64 undef, i64 undef
15 ; CHECK: cost of 1 {{.*}} select
16 %v5 = select i1 undef, float undef, float undef
17 ; CHECK: cost of 1 {{.*}} select
18 %v6 = select i1 undef, double undef, double undef
19
Silviu Barangaa3e27ed2015-09-09 15:35:02 +000020 ; CHECK: cost of 16 {{.*}} select
Tim Northover00ed9962014-03-29 10:18:08 +000021 %v13b = select <16 x i1> undef, <16 x i16> undef, <16 x i16> undef
22
Silviu Barangaa3e27ed2015-09-09 15:35:02 +000023 ; CHECK: cost of 8 {{.*}} select
Tim Northover00ed9962014-03-29 10:18:08 +000024 %v15b = select <8 x i1> undef, <8 x i32> undef, <8 x i32> undef
Silviu Barangaa3e27ed2015-09-09 15:35:02 +000025 ; CHECK: cost of 16 {{.*}} select
Tim Northover00ed9962014-03-29 10:18:08 +000026 %v15c = select <16 x i1> undef, <16 x i32> undef, <16 x i32> undef
27
Silviu Barangaa3e27ed2015-09-09 15:35:02 +000028 ; Vector values - check for vectors of i64s that have a high cost because
29 ; they end up scalarized.
Tim Northover00ed9962014-03-29 10:18:08 +000030 ; CHECK: cost of 80 {{.*}} select
31 %v16a = select <4 x i1> undef, <4 x i64> undef, <4 x i64> undef
32 ; CHECK: cost of 160 {{.*}} select
33 %v16b = select <8 x i1> undef, <8 x i64> undef, <8 x i64> undef
34 ; CHECK: cost of 320 {{.*}} select
35 %v16c = select <16 x i1> undef, <16 x i64> undef, <16 x i64> undef
36
Silviu Barangaa3e27ed2015-09-09 15:35:02 +000037 ret void
Tim Northover00ed9962014-03-29 10:18:08 +000038}