[llvm] [X86] Lower vector integer division and remainder through float division (PR #205263)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 2 02:42:34 PDT 2026
================
@@ -50564,6 +50572,200 @@ static SDValue combineMulToPMADD52(SDNode *N, const SDLoc &DL,
return SDValue();
}
+// x86 has no vector integer divide instructions. Lower vector
+// UDIV/SDIV/UREM/SREM through float division instead of scalarizing into N
+// scalar hardware divides.
+static SDValue combineIntDivRem(SDNode *N, SelectionDAG &DAG,
+ TargetLowering::DAGCombinerInfo &DCI,
+ const X86Subtarget &Subtarget) {
+ EVT VT = N->getValueType(0);
+ SDLoc DL(N);
+
+ // Run before the legalizer expands the division.
+ if (!VT.isVector() || !Subtarget.hasSSE2() || !DCI.isBeforeLegalizeOps())
----------------
phoebewang wrote:
Is `DCI.isBeforeLegalizeOps` redundant given we check `VT.isVector`?
https://github.com/llvm/llvm-project/pull/205263
More information about the llvm-commits
mailing list