[llvm] [X86] Lower scalar bf16 arithmetic on AVX10.2 via packed ops (PR #212245)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 01:16:00 PDT 2026


================
@@ -34531,6 +34540,30 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
     N->dump(&DAG);
 #endif
     llvm_unreachable("Do not know how to custom type legalize this operation!");
+  case ISD::FADD:
+  case ISD::FSUB:
+  case ISD::FMUL:
+  case ISD::FSQRT:
+  case ISD::FDIV:
+  case ISD::FMA: {
+    if (N->getValueType(0) == MVT::bf16) {
----------------
RKSimon wrote:

You'd be better off dropping the if() and just asserting the type is bf16

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


More information about the llvm-commits mailing list