[llvm] [X86] Keep scalar bf16/f16 selects in vector registers (PR #224218)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 00:21:56 PDT 2026


================
@@ -2076,3 +2076,446 @@ define bfloat @PR115710(fp128 %0) nounwind {
   %2 = fptrunc fp128 %0 to bfloat
   ret bfloat %2
 }
+
+define bfloat @select_bf16(i1 %cond, bfloat %a, bfloat %b) nounwind {
+; X86-LABEL: select_bf16:
+; X86:       # %bb.0:
+; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)
+; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    leal {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    cmovnel %eax, %ecx
+; X86-NEXT:    vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
----------------
phoebewang wrote:

Oh, they are pointers.

https://github.com/llvm/llvm-project/pull/224218


More information about the llvm-commits mailing list