1 ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output \
2 ; RUN: -mtriple=s390x-unknown-linux -mcpu=z13 | FileCheck %s
4 ; Check that getInstructionCost() does not return TCC_Free for extensions of
5 ; i1 returned from icmp.
7 define i64 @fun1(i64 %v) {
9 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %cmp = icmp eq i64 %v, 0
10 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %z = zext i1 %cmp to i64
11 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %z
12 %cmp = icmp eq i64 %v, 0
13 %z = zext i1 %cmp to i64
17 define i64 @fun2(i64 %v) {
19 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %cmp = icmp eq i64 %v, 0
20 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %z = sext i1 %cmp to i64
21 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %z
22 %cmp = icmp eq i64 %v, 0
23 %z = sext i1 %cmp to i64
27 define double @fun3(i64 %v) {
29 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %cmp = icmp eq i64 %v, 0
30 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %z = uitofp i1 %cmp to double
31 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret double %z
32 %cmp = icmp eq i64 %v, 0
33 %z = uitofp i1 %cmp to double
37 define double @fun4(i64 %v) {
39 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %cmp = icmp eq i64 %v, 0
40 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %z = sitofp i1 %cmp to double
41 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret double %z
42 %cmp = icmp eq i64 %v, 0
43 %z = sitofp i1 %cmp to double
47 define i64 @fun5(i1 %v) {
49 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %z = zext i1 %v to i64
50 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %z
51 %z = zext i1 %v to i64