[llvm] [X86] Stop custom-widening v2f32 = fpext v2bf16 (PR #80106)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 23:43:44 PST 2024


================
@@ -32815,10 +32815,11 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
     // No other ValueType for FP_EXTEND should reach this point.
     assert(N->getValueType(0) == MVT::v2f32 &&
            "Do not know how to legalize this Node");
-    if (!Subtarget.hasFP16() || !Subtarget.hasVLX())
-      return;
     bool IsStrict = N->isStrictFPOpcode();
     SDValue Src = N->getOperand(IsStrict ? 1 : 0);
+    if (!Subtarget.hasFP16() || !Subtarget.hasVLX() ||
+        Src.getValueType().getVectorElementType() != MVT::f16)
+      return;
----------------
phoebewang wrote:

I think it's better to just add
```
if (Src.getValueType().getVectorElementType() != MVT::f1)
  return;
```

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


More information about the llvm-commits mailing list