[all-commits] [llvm/llvm-project] 59f4a8: [X86] Fix `"Cannot select"` for `bf16` vector sele...

Akash Manna via All-commits all-commits at lists.llvm.org
Mon Sep 14 03:26:25 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59f4a867528eeb8cd8823afb0ee4e5c4d2843741
      https://github.com/llvm/llvm-project/commit/59f4a867528eeb8cd8823afb0ee4e5c4d2843741
  Author: Akash Manna <akash.manna.mymail at gmail.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    A llvm/test/CodeGen/X86/pseudo_cmov_lower-bf16.ll

  Log Message:
  -----------
  [X86] Fix `"Cannot select"` for `bf16` vector selects on a scalar condition under `AVX10.2` (#222854)

Fixes #222673

A `select i1 %c, <8 x bfloat> %a, <8 x bfloat> %b` failed instruction
selection with `+avx10.2-512` on a `v8bf16 X86ISD::CMOV`. Selects on a
scalar condition are lowered to the `CMOV_VR*` pseudos and expanded to a
branch, but those pseudos only have patterns for integer and f16
vectors. Before #101603 bf16 vectors were treated as "soft" everywhere,
so `LowerSELECT` bitcast them to `v8i16` first and never produced a bf16
CMOV. That PR made bf16 non-soft under AVX10.2 to enable native
arithmetic, which silently removed the only bf16-aware path in
`LowerSELECT` without adding a replacement. `v16bf16` and `v32bf16` hit
the same thing.

`LowerSELECT` now takes the integer-bitcast path for every bf16 vector,
using the existing `isBF16orSoftF16` helper, so the select is lowered
exactly as it is on every other bf16 target and as `v8f16` is on FP16
targets. Scalar `bf16` is soft-promoted to `f32` before lowering, so it
is unaffected. Added `pseudo_cmov_lower-bf16.ll` alongside the f16
sibling, covering the reproducer plus `v8/v16/v32bf16` on both
`+avx512bf16,+avx512vl` and `+avx10.2-512`.



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