1 ; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 \
2 ; RUN: | FileCheck %s -check-prefixes=CHECK,Z13
3 ; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z15 \
4 ; RUN: | FileCheck %s -check-prefixes=CHECK,Z15
6 define void @fun0(i32 %a) {
7 ; CHECK-LABEL: Printing analysis 'Cost Model Analysis' for function 'fun0':
8 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c0 = xor i32 %l0, -1
9 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res0 = or i32 %a, %c0
10 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res0 = or i32 %a, %c0
11 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c1 = xor i32 %l1, -1
12 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res1 = and i32 %a, %c1
13 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res1 = and i32 %a, %c1
14 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c2 = and i32 %l2, %a
15 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res2 = xor i32 %c2, -1
16 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res2 = xor i32 %c2, -1
17 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c3 = or i32 %l3, %a
18 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res3 = xor i32 %c3, -1
19 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res3 = xor i32 %c3, -1
20 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c4 = xor i32 %l4, %a
21 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res4 = xor i32 %c4, -1
22 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res4 = xor i32 %c4, -1
25 %l0 = load i32, i32* undef
27 %res0 = or i32 %a, %c0
28 store i32 %res0, i32* undef
30 %l1 = load i32, i32* undef
32 %res1 = and i32 %a, %c1
33 store i32 %res1, i32* undef
35 %l2 = load i32, i32* undef
37 %res2 = xor i32 %c2, -1
38 store i32 %res2, i32* undef
40 %l3 = load i32, i32* undef
42 %res3 = xor i32 %c3, -1
43 store i32 %res3, i32* undef
45 %l4 = load i32, i32* undef
47 %res4 = xor i32 %c4, -1
48 store i32 %res4, i32* undef
53 define void @fun1(i64 %a) {
54 ; CHECK-LABEL: Printing analysis 'Cost Model Analysis' for function 'fun1':
55 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c0 = xor i64 %l0, -1
56 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res0 = or i64 %a, %c0
57 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res0 = or i64 %a, %c0
58 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c1 = xor i64 %l1, -1
59 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res1 = and i64 %a, %c1
60 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res1 = and i64 %a, %c1
61 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c2 = and i64 %l2, %a
62 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res2 = xor i64 %c2, -1
63 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res2 = xor i64 %c2, -1
64 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c3 = or i64 %l3, %a
65 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res3 = xor i64 %c3, -1
66 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res3 = xor i64 %c3, -1
67 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c4 = xor i64 %l4, %a
68 ; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res4 = xor i64 %c4, -1
69 ; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res4 = xor i64 %c4, -1
71 %l0 = load i64, i64* undef
73 %res0 = or i64 %a, %c0
74 store i64 %res0, i64* undef
76 %l1 = load i64, i64* undef
78 %res1 = and i64 %a, %c1
79 store i64 %res1, i64* undef
81 %l2 = load i64, i64* undef
83 %res2 = xor i64 %c2, -1
84 store i64 %res2, i64* undef
86 %l3 = load i64, i64* undef
88 %res3 = xor i64 %c3, -1
89 store i64 %res3, i64* undef
91 %l4 = load i64, i64* undef
93 %res4 = xor i64 %c4, -1
94 store i64 %res4, i64* undef