1 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
3 target 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 target triple = "x86_64-apple-macosx10.8.0"
6 define i32 @insert-extract-at-zero-idx(i32 %arg, float %fl) {
7 ;CHECK: cost of 0 {{.*}} extract
8 %A = extractelement <4 x float> undef, i32 0
9 ;CHECK: cost of 1 {{.*}} extract
10 %B = extractelement <4 x i32> undef, i32 0
11 ;CHECK: cost of 1 {{.*}} extract
12 %C = extractelement <4 x float> undef, i32 1
14 ;CHECK: cost of 0 {{.*}} extract
15 %D = extractelement <8 x float> undef, i32 0
16 ;CHECK: cost of 1 {{.*}} extract
17 %E = extractelement <8 x float> undef, i32 1
19 ;CHECK: cost of 3 {{.*}} extract
20 %F = extractelement <8 x float> undef, i32 %arg
22 ;CHECK: cost of 0 {{.*}} insert
23 %G = insertelement <4 x float> poison, float %fl, i32 0
24 ;CHECK: cost of 1 {{.*}} insert
25 %H = insertelement <4 x float> poison, float %fl, i32 1
26 ;CHECK: cost of 1 {{.*}} insert
27 %I = insertelement <4 x i32> poison, i32 %arg, i32 0
29 ;CHECK: cost of 0 {{.*}} insert
30 %J = insertelement <4 x double> poison, double undef, i32 0
32 ;CHECK: cost of 0 {{.*}} insert
33 %K = insertelement <8 x double> poison, double undef, i32 4
34 ;CHECK: cost of 0 {{.*}} insert
35 %L = insertelement <16 x double> poison, double undef, i32 8
36 ;CHECK: cost of 1 {{.*}} insert
37 %M = insertelement <16 x double> poison, double undef, i32 9