1 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx | FileCheck %s
2 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr9 -mattr=+vsx | FileCheck --check-prefix=CHECK-P9 %s
4 define void @testi16(i16 %arg1, i16 %arg2, ptr %arg3) {
6 %s1 = add i16 %arg1, %arg2
7 %s2 = zext i16 %arg1 to i32
8 %s3 = load i16, ptr %arg3
9 store i16 %arg2, ptr %arg3
10 %c = icmp eq i16 %arg1, %arg2
13 ; CHECK: cost of 1 {{.*}} add
14 ; CHECK: cost of 1 {{.*}} zext
15 ; CHECK: cost of 1 {{.*}} load
16 ; CHECK: cost of 1 {{.*}} store
17 ; CHECK: cost of 1 {{.*}} icmp
18 ; CHECK-P9: cost of 1 {{.*}} add
19 ; CHECK-P9: cost of 1 {{.*}} zext
20 ; CHECK-P9: cost of 1 {{.*}} load
21 ; CHECK-P9: cost of 1 {{.*}} store
22 ; CHECK-P9: cost of 1 {{.*}} icmp
25 define void @test4xi16(<4 x i16> %arg1, <4 x i16> %arg2) {
27 %v1 = add <4 x i16> %arg1, %arg2
28 %v2 = zext <4 x i16> %arg1 to <4 x i32>
29 %v3 = shufflevector <4 x i16> %arg1, <4 x i16> undef, <4 x i32> zeroinitializer
30 %c = icmp eq <4 x i16> %arg1, %arg2
33 ; CHECK: cost of 1 {{.*}} add
34 ; CHECK: cost of 1 {{.*}} zext
35 ; CHECK: cost of 1 {{.*}} shufflevector
36 ; CHECK: cost of 1 {{.*}} icmp
37 ; CHECK-P9: cost of 2 {{.*}} add
38 ; CHECK-P9: cost of 2 {{.*}} zext
39 ; CHECK-P9: cost of 2 {{.*}} shufflevector
40 ; CHECK-P9: cost of 2 {{.*}} icmp
43 define void @test4xi32(<4 x i32> %arg1, <4 x i32> %arg2, ptr %arg3) {
45 %v1 = load <4 x i32>, ptr %arg3
46 store <4 x i32> %arg2, ptr %arg3
49 ; CHECK: cost of 1 {{.*}} load
50 ; CHECK: cost of 1 {{.*}} store
51 ; CHECK-P9: cost of 2 {{.*}} load
52 ; CHECK-P9: cost of 2 {{.*}} store