xref: /llvm-project/llvm/test/Analysis/CostModel/PowerPC/vector_unit.ll (revision 68c50b111d74afb9489cf97770fa917d0a1c7f77)
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
3
4define void @testi16(i16 %arg1, i16 %arg2, ptr %arg3) {
5
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
11
12  ret void
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
23}
24
25define void @test4xi16(<4 x i16> %arg1, <4 x i16> %arg2) {
26
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
31
32  ret void
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
41}
42
43define void @test4xi32(<4 x i32> %arg1, <4 x i32> %arg2, ptr %arg3) {
44
45  %v1 = load <4 x i32>, ptr %arg3
46  store <4 x i32> %arg2, ptr %arg3
47
48  ret void
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
53}
54