Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -cost-model -analyze -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s |
| 2 | target 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 |
| 5 | define 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 Baranga | a3e27ed | 2015-09-09 15:35:02 +0000 | [diff] [blame] | 20 | ; CHECK: cost of 16 {{.*}} select |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 21 | %v13b = select <16 x i1> undef, <16 x i16> undef, <16 x i16> undef |
| 22 | |
Silviu Baranga | a3e27ed | 2015-09-09 15:35:02 +0000 | [diff] [blame] | 23 | ; CHECK: cost of 8 {{.*}} select |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 24 | %v15b = select <8 x i1> undef, <8 x i32> undef, <8 x i32> undef |
Silviu Baranga | a3e27ed | 2015-09-09 15:35:02 +0000 | [diff] [blame] | 25 | ; CHECK: cost of 16 {{.*}} select |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 26 | %v15c = select <16 x i1> undef, <16 x i32> undef, <16 x i32> undef |
| 27 | |
Silviu Baranga | a3e27ed | 2015-09-09 15:35:02 +0000 | [diff] [blame] | 28 | ; Vector values - check for vectors of i64s that have a high cost because |
| 29 | ; they end up scalarized. |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 30 | ; 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 Baranga | a3e27ed | 2015-09-09 15:35:02 +0000 | [diff] [blame] | 37 | ret void |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 38 | } |