xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/X86/insert-extract-at-zero.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-macosx10.8.0"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i32 @insert-extract-at-zero-idx(i32 %arg, float %fl) {
7*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} extract
8*9880d681SAndroid Build Coastguard Worker  %A = extractelement <4 x float> undef, i32 0
9*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} extract
10*9880d681SAndroid Build Coastguard Worker  %B = extractelement <4 x i32> undef, i32 0
11*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} extract
12*9880d681SAndroid Build Coastguard Worker  %C = extractelement <4 x float> undef, i32 1
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} extract
15*9880d681SAndroid Build Coastguard Worker  %D = extractelement <8 x float> undef, i32 0
16*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} extract
17*9880d681SAndroid Build Coastguard Worker  %E = extractelement <8 x float> undef, i32 1
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} extract
20*9880d681SAndroid Build Coastguard Worker  %F = extractelement <8 x float> undef, i32 %arg
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} insert
23*9880d681SAndroid Build Coastguard Worker  %G = insertelement <4 x float> undef, float %fl, i32 0
24*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} insert
25*9880d681SAndroid Build Coastguard Worker  %H = insertelement <4 x float> undef, float %fl, i32 1
26*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} insert
27*9880d681SAndroid Build Coastguard Worker  %I = insertelement <4 x i32> undef, i32 %arg, i32 0
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} insert
30*9880d681SAndroid Build Coastguard Worker  %J = insertelement <4 x double> undef, double undef, i32 0
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} insert
33*9880d681SAndroid Build Coastguard Worker  %K = insertelement <8 x double> undef, double undef, i32 4
34*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} insert
35*9880d681SAndroid Build Coastguard Worker  %L = insertelement <16 x double> undef, double undef, i32 8
36*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} insert
37*9880d681SAndroid Build Coastguard Worker  %M = insertelement <16 x double> undef, double undef, i32 9
38*9880d681SAndroid Build Coastguard Worker  ret i32 0
39*9880d681SAndroid Build Coastguard Worker}
40*9880d681SAndroid Build Coastguard Worker
41