llvm-project
185ff0c9 - [X86] Fix i64-to-bf16 conversion crash on 32-bit targets (#222934)

Commit
4 days ago
[X86] Fix i64-to-bf16 conversion crash on 32-bit targets (#222934) Converting a loaded `i64` to `bfloat` can crash instruction selection on i686: ```llvm define bfloat @convert(ptr %p) { %value = load i64, ptr %p %result = sitofp i64 %value to bfloat ret bfloat %result } ``` With `llc -mtriple=i686-linux-gnu`, this hits: ```text Do not know how to custom type legalize this operation! ``` The X86 DAG combine folds the load and conversion into an x87 `FILD` node before type legalization. It already excludes `f16` and `f128`, but was missing `bf16`, leaving the legalizer with an unsupported result type. Add `bf16` to that exclusion. This lets the existing legalization promote the conversion through `f32` and then round to bf16. The change also covers the constrained signed conversion, which uses the same combine. Assisted by: Fable 5.1, Astra 6
Author
Parents
Loading