[llvm] [X86] use vdivph for i8 integer division on avx512fp16 (PR #215131)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 20:49:20 PDT 2026


================
@@ -50669,10 +50669,21 @@ static SDValue combineIntDivRem(SDNode *N, SelectionDAG &DAG,
 
   // f32 recovers the quotient exactly when both operands fit in 24 bits
   MVT FPSclVT = MVT::f64;
-  if (EltBits <= 16 || BothFitFP(APFloat::IEEEsingle()))
+  EVT FP16VT = VT.changeVectorElementType(*DAG.getContext(), MVT::f16);
+  bool FP16VTUsable =
+      DCI.isBeforeLegalize() || DAG.getTargetLoweringInfo().isTypeLegal(FP16VT);
----------------
phoebewang wrote:

What's isBeforeLegalize used for?

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


More information about the llvm-commits mailing list