1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt < %s -mtriple=riscv64 -mattr=+f,+d -disable-output -passes="print<cost-model>" 2>&1 | FileCheck %s
4 define i8 @phi_i8(i1 %c) {
5 ; CHECK-LABEL: 'phi_i8'
6 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
7 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
8 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
9 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i8 [ 16, %a ], [ 32, %b ]
10 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %x
12 br i1 %c, label %a, label %b
18 %x = phi i8 [16, %a], [32, %b]
22 define i16 @phi_i16_small(i1 %c) {
23 ; CHECK-LABEL: 'phi_i16_small'
24 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
25 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
26 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
27 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i16 [ 1, %a ], [ 2, %b ]
28 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %x
30 br i1 %c, label %a, label %b
36 %x = phi i16 [1, %a], [2, %b]
40 define i16 @phi_i16_large(i1 %c) {
41 ; CHECK-LABEL: 'phi_i16_large'
42 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
43 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
44 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
45 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i16 [ 42, %a ], [ -7616, %b ]
46 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %x
48 br i1 %c, label %a, label %b
54 %x = phi i16 [42, %a], [123456, %b]
58 define i32 @phi_i32_small(i1 %c) {
59 ; CHECK-LABEL: 'phi_i32_small'
60 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
61 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
62 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
63 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i32 [ 1, %a ], [ 2, %b ]
64 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %x
66 br i1 %c, label %a, label %b
72 %x = phi i32 [1, %a], [2, %b]
76 define i32 @phi_i32_large(i1 %c) {
77 ; CHECK-LABEL: 'phi_i32_large'
78 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
79 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
80 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
81 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i32 [ 42, %a ], [ 123456, %b ]
82 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %x
84 br i1 %c, label %a, label %b
90 %x = phi i32 [42, %a], [123456, %b]
94 define i64 @phi_i64_small(i1 %c) {
95 ; CHECK-LABEL: 'phi_i64_small'
96 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
97 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
98 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
99 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i64 [ 1, %a ], [ 2, %b ]
100 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %x
102 br i1 %c, label %a, label %b
108 %x = phi i64 [1, %a], [2, %b]
112 define i64 @phi_i64_large(i1 %c) {
113 ; CHECK-LABEL: 'phi_i64_large'
114 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
115 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
116 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
117 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i64 [ 42, %a ], [ 123456, %b ]
118 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %x
120 br i1 %c, label %a, label %b
126 %x = phi i64 [42, %a], [123456, %b]
130 define half @phi_f16(i1 %c) {
131 ; CHECK-LABEL: 'phi_f16'
132 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
133 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
134 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
135 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi half [ 0xHE3CE, %a ], [ 0xH5144, %b ]
136 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret half %x
138 br i1 %c, label %a, label %b
144 %x = phi half [-999.0, %a], [42.125, %b]
148 define float @phi_f32(i1 %c) {
149 ; CHECK-LABEL: 'phi_f32'
150 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
151 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
152 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
153 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi float [ -9.990000e+02, %a ], [ 4.212500e+01, %b ]
154 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %x
156 br i1 %c, label %a, label %b
162 %x = phi float [-999.0, %a], [42.125, %b]
166 define double @phi_f64(i1 %c) {
167 ; CHECK-LABEL: 'phi_f64'
168 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
169 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
170 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
171 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi double [ -9.990000e+02, %a ], [ 4.212500e+01, %b ]
172 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %x
174 br i1 %c, label %a, label %b
180 %x = phi double [-999.0, %a], [42.125, %b]