1 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 \
2 ; RUN: | FileCheck %s -check-prefixes=CHECK,Z13
3 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z15 \
4 ; RUN: | FileCheck %s -check-prefixes=CHECK,Z15
6 define void @fun0(i32 %a) {
7 ; CHECK-LABEL: 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, ptr undef
27 %res0 = or i32 %a, %c0
28 store i32 %res0, ptr undef
30 %l1 = load i32, ptr undef
32 %res1 = and i32 %a, %c1
33 store i32 %res1, ptr undef
35 %l2 = load i32, ptr undef
37 %res2 = xor i32 %c2, -1
38 store i32 %res2, ptr undef
40 %l3 = load i32, ptr undef
42 %res3 = xor i32 %c3, -1
43 store i32 %res3, ptr undef
45 %l4 = load i32, ptr undef
47 %res4 = xor i32 %c4, -1
48 store i32 %res4, ptr undef
53 define void @fun1(i64 %a) {
54 ; CHECK-LABEL: 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, ptr undef
73 %res0 = or i64 %a, %c0
74 store i64 %res0, ptr undef
76 %l1 = load i64, ptr undef
78 %res1 = and i64 %a, %c1
79 store i64 %res1, ptr undef
81 %l2 = load i64, ptr undef
83 %res2 = xor i64 %c2, -1
84 store i64 %res2, ptr undef
86 %l3 = load i64, ptr undef
88 %res3 = xor i64 %c3, -1
89 store i64 %res3, ptr undef
91 %l4 = load i64, ptr undef
93 %res4 = xor i64 %c4, -1
94 store i64 %res4, ptr undef