[llvm] [X86] `combinePMULH` - combine `mulhu` + `srl` (PR #132548)
Abhishek Kaushik via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 13 04:56:24 PDT 2025
================
@@ -54046,10 +54046,16 @@ static SDValue combinePMULH(SDValue Src, EVT VT, const SDLoc &DL,
// First instruction should be a right shift by 16 of a multiply.
SDValue LHS, RHS;
+ APInt ShiftAmt;
if (!sd_match(Src,
- m_Srl(m_Mul(m_Value(LHS), m_Value(RHS)), m_SpecificInt(16))))
+ m_Srl(m_Mul(m_Value(LHS), m_Value(RHS)), m_ConstInt(ShiftAmt))))
+ return SDValue();
+
+ if (ShiftAmt.ult(16))
----------------
abhishek-kaushik22 wrote:
I tried by a shift value of that size, but the DAG builder replaces that node with `undef` so the condition was not being hit
https://github.com/llvm/llvm-project/pull/132548
More information about the llvm-commits
mailing list