[llvm] [X86] `combinePMULH` - combine `mulhu` + `srl` (PR #132548)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 08:21:46 PDT 2025
================
@@ -54231,10 +54231,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))
----------------
RKSimon wrote:
`if (ShiftAmt.ult(16) || ShiftAmt.uge(InVT.getScalarSizeInBits()))` - because eventually a fuzz test will come along and try to break things :(
https://github.com/llvm/llvm-project/pull/132548
More information about the llvm-commits
mailing list