[all-commits] [llvm/llvm-project] 185ff0: [X86] Fix i64-to-bf16 conversion crash on 32-bit t...
Tim Besard via All-commits
all-commits at lists.llvm.org
Fri Sep 11 08:05:17 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 185ff0c972cbdf0f221fbf1f45b8554810da79eb
https://github.com/llvm/llvm-project/commit/185ff0c972cbdf0f221fbf1f45b8554810da79eb
Author: Tim Besard <tim.besard at gmail.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/lib/Target/X86/X86ISelLowering.cpp
A llvm/test/CodeGen/X86/bfloat-int64-cvt-i686.ll
Log Message:
-----------
[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
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list