xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/AArch64/kryo.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -cost-model -analyze -mcpu=kryo | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
4*9880d681SAndroid Build Coastguard Workertarget triple = "aarch64--linux-gnu"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: vectorInstrCost
7*9880d681SAndroid Build Coastguard Workerdefine void @vectorInstrCost() {
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker    ; Vector extracts - extracting the first element should have a zero cost;
10*9880d681SAndroid Build Coastguard Worker    ; all other elements should have a cost of two.
11*9880d681SAndroid Build Coastguard Worker    ;
12*9880d681SAndroid Build Coastguard Worker    ; CHECK: cost of 0 {{.*}} extractelement <2 x i64> undef, i32 0
13*9880d681SAndroid Build Coastguard Worker    ; CHECK: cost of 2 {{.*}} extractelement <2 x i64> undef, i32 1
14*9880d681SAndroid Build Coastguard Worker    %t1 = extractelement <2 x i64> undef, i32 0
15*9880d681SAndroid Build Coastguard Worker    %t2 = extractelement <2 x i64> undef, i32 1
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker    ; Vector inserts - inserting the first element should have a zero cost; all
18*9880d681SAndroid Build Coastguard Worker    ; other elements should have a cost of two.
19*9880d681SAndroid Build Coastguard Worker    ;
20*9880d681SAndroid Build Coastguard Worker    ; CHECK: cost of 0 {{.*}} insertelement <2 x i64> undef, i64 undef, i32 0
21*9880d681SAndroid Build Coastguard Worker    ; CHECK: cost of 2 {{.*}} insertelement <2 x i64> undef, i64 undef, i32 1
22*9880d681SAndroid Build Coastguard Worker    %t3 = insertelement <2 x i64> undef, i64 undef, i32 0
23*9880d681SAndroid Build Coastguard Worker    %t4 = insertelement <2 x i64> undef, i64 undef, i32 1
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker    ret void
26*9880d681SAndroid Build Coastguard Worker}
27