1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -mtriple=riscv64 -mattr=+f,+d -disable-output -passes="print<cost-model>" 2>&1 | FileCheck %s
define i8 @phi_i8(i1 %c) {
; CHECK-LABEL: 'phi_i8'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i8 [ 16, %a ], [ 32, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i8 [16, %a], [32, %b]
ret i8 %x
}
define i16 @phi_i16_small(i1 %c) {
; CHECK-LABEL: 'phi_i16_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i16 [ 1, %a ], [ 2, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i16 [1, %a], [2, %b]
ret i16 %x
}
define i16 @phi_i16_large(i1 %c) {
; CHECK-LABEL: 'phi_i16_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i16 [ 42, %a ], [ -7616, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i16 [42, %a], [123456, %b]
ret i16 %x
}
define i32 @phi_i32_small(i1 %c) {
; CHECK-LABEL: 'phi_i32_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i32 [ 1, %a ], [ 2, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i32 [1, %a], [2, %b]
ret i32 %x
}
define i32 @phi_i32_large(i1 %c) {
; CHECK-LABEL: 'phi_i32_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i32 [ 42, %a ], [ 123456, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i32 [42, %a], [123456, %b]
ret i32 %x
}
define i64 @phi_i64_small(i1 %c) {
; CHECK-LABEL: 'phi_i64_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i64 [ 1, %a ], [ 2, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i64 [1, %a], [2, %b]
ret i64 %x
}
define i64 @phi_i64_large(i1 %c) {
; CHECK-LABEL: 'phi_i64_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi i64 [ 42, %a ], [ 123456, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi i64 [42, %a], [123456, %b]
ret i64 %x
}
define half @phi_f16(i1 %c) {
; CHECK-LABEL: 'phi_f16'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi half [ 0xHE3CE, %a ], [ 0xH5144, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi half [-999.0, %a], [42.125, %b]
ret half %x
}
define float @phi_f32(i1 %c) {
; CHECK-LABEL: 'phi_f32'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi float [ -9.990000e+02, %a ], [ 4.212500e+01, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi float [-999.0, %a], [42.125, %b]
ret float %x
}
define double @phi_f64(i1 %c) {
; CHECK-LABEL: 'phi_f64'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = phi double [ -9.990000e+02, %a ], [ 4.212500e+01, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi double [-999.0, %a], [42.125, %b]
ret double %x
}
|