[llvm] [X86] `combinePMULH` - combine `mulhu` + `srl` (PR #132548)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 24 04:01:25 PDT 2025


================
@@ -54087,15 +54093,19 @@ static SDValue combinePMULH(SDValue Src, EVT VT, const SDLoc &DL,
                                 InVT.getSizeInBits() / 16);
     SDValue Res = DAG.getNode(ISD::MULHU, DL, BCVT, DAG.getBitcast(BCVT, LHS),
                               DAG.getBitcast(BCVT, RHS));
-    return DAG.getNode(ISD::TRUNCATE, DL, VT, DAG.getBitcast(InVT, Res));
+    Res = DAG.getNode(ISD::TRUNCATE, DL, VT, DAG.getBitcast(InVT, Res));
+    return DAG.getNode(ISD::SRL, DL, VT, Res,
+                       DAG.getConstant(AdditionalShift, DL, VT));
----------------
RKSimon wrote:

getShiftAmountConstant

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


More information about the llvm-commits mailing list