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 5 6define 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 23 24entry: 25 %l0 = load i32, i32* undef 26 %c0 = xor i32 %l0, -1 27 %res0 = or i32 %a, %c0 28 store i32 %res0, i32* undef 29 30 %l1 = load i32, i32* undef 31 %c1 = xor i32 %l1, -1 32 %res1 = and i32 %a, %c1 33 store i32 %res1, i32* undef 34 35 %l2 = load i32, i32* undef 36 %c2 = and i32 %l2, %a 37 %res2 = xor i32 %c2, -1 38 store i32 %res2, i32* undef 39 40 %l3 = load i32, i32* undef 41 %c3 = or i32 %l3, %a 42 %res3 = xor i32 %c3, -1 43 store i32 %res3, i32* undef 44 45 %l4 = load i32, i32* undef 46 %c4 = xor i32 %l4, %a 47 %res4 = xor i32 %c4, -1 48 store i32 %res4, i32* undef 49 50 ret void 51} 52 53define 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 70entry: 71 %l0 = load i64, i64* undef 72 %c0 = xor i64 %l0, -1 73 %res0 = or i64 %a, %c0 74 store i64 %res0, i64* undef 75 76 %l1 = load i64, i64* undef 77 %c1 = xor i64 %l1, -1 78 %res1 = and i64 %a, %c1 79 store i64 %res1, i64* undef 80 81 %l2 = load i64, i64* undef 82 %c2 = and i64 %l2, %a 83 %res2 = xor i64 %c2, -1 84 store i64 %res2, i64* undef 85 86 %l3 = load i64, i64* undef 87 %c3 = or i64 %l3, %a 88 %res3 = xor i64 %c3, -1 89 store i64 %res3, i64* undef 90 91 %l4 = load i64, i64* undef 92 %c4 = xor i64 %l4, %a 93 %res4 = xor i64 %c4, -1 94 store i64 %res4, i64* undef 95 96 ret void 97} 98