Commit 3f6dd2c
[LegalizeTypes][X86] Improve ExpandIntRes_FP_TO_SINT/ExpandIntRes_FP_TO_UINT when input is SoftPromoteHalf.
Instead of splitting off the fp16 to float conversion and generating
a libcall, we should split the operation into fp16 to float and float
to integer operations. This will allow the float to integer conversion
to go through any custom handling the target has. If the target doesn't
have custom handling then we should come back to ExpandIntRes_FP_TO_SINT/
ExpandIntRes_FP_TO_UINT automatically to create the libcall.
This avoids generating libcalls on 32-bit X86. These library functions may
not exist in 32-bit libgcc. At least for LLVM, we never generate them when
hardware floating point instructions are available.
Differential Revision: https://reviews.llvm.org/D108933
(cherry picked from commit 201f644)1 parent 1fccc83 commit 3f6dd2c
File tree
2 files changed
+44
-8
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/X86
2 files changed
+44
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3022 | 3022 | | |
3023 | 3023 | | |
3024 | 3024 | | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
3025 | 3028 | | |
3026 | 3029 | | |
3027 | 3030 | | |
| |||
3051 | 3054 | | |
3052 | 3055 | | |
3053 | 3056 | | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
3054 | 3060 | | |
3055 | 3061 | | |
3056 | 3062 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
221 | 230 | | |
222 | 231 | | |
223 | 232 | | |
| |||
298 | 307 | | |
299 | 308 | | |
300 | 309 | | |
301 | | - | |
| 310 | + | |
302 | 311 | | |
303 | 312 | | |
304 | 313 | | |
305 | 314 | | |
306 | | - | |
307 | | - | |
308 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
309 | 339 | | |
310 | 340 | | |
311 | 341 | | |
| |||
0 commit comments