xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/AArch64/select.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s  -cost-model -analyze -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget 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*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: select
5*9880d681SAndroid Build Coastguard Workerdefine void @select() {
6*9880d681SAndroid Build Coastguard Worker    ; Scalar values
7*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} select
8*9880d681SAndroid Build Coastguard Worker  %v1 = select i1 undef, i8 undef, i8 undef
9*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} select
10*9880d681SAndroid Build Coastguard Worker  %v2 = select i1 undef, i16 undef, i16 undef
11*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} select
12*9880d681SAndroid Build Coastguard Worker  %v3 = select i1 undef, i32 undef, i32 undef
13*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} select
14*9880d681SAndroid Build Coastguard Worker  %v4 = select i1 undef, i64 undef, i64 undef
15*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} select
16*9880d681SAndroid Build Coastguard Worker  %v5 = select i1 undef, float undef, float undef
17*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} select
18*9880d681SAndroid Build Coastguard Worker  %v6 = select i1 undef, double undef, double undef
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 16 {{.*}} select
21*9880d681SAndroid Build Coastguard Worker  %v13b = select <16 x i1>  undef, <16 x i16> undef, <16 x i16> undef
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 8 {{.*}} select
24*9880d681SAndroid Build Coastguard Worker  %v15b = select <8 x i1>  undef, <8 x i32> undef, <8 x i32> undef
25*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 16 {{.*}} select
26*9880d681SAndroid Build Coastguard Worker  %v15c = select <16 x i1>  undef, <16 x i32> undef, <16 x i32> undef
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker  ; Vector values - check for vectors of i64s that have a high cost because
29*9880d681SAndroid Build Coastguard Worker  ; they end up scalarized.
30*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 80 {{.*}} select
31*9880d681SAndroid Build Coastguard Worker  %v16a = select <4 x i1> undef, <4 x i64> undef, <4 x i64> undef
32*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 160 {{.*}} select
33*9880d681SAndroid Build Coastguard Worker  %v16b = select <8 x i1> undef, <8 x i64> undef, <8 x i64> undef
34*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 320 {{.*}} select
35*9880d681SAndroid Build Coastguard Worker  %v16c = select <16 x i1> undef, <16 x i64> undef, <16 x i64> undef
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker  ret void
38*9880d681SAndroid Build Coastguard Worker}
39