[llvm] [RISCV] Don't select sh{1, 2, 3}add if shl doesn't have one use (PR #143351)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 08:59:34 PDT 2025


================
@@ -14887,6 +14887,9 @@ static SDValue combineShlAddIAddImpl(SDNode *N, SDValue AddI, SDValue Other,
   if (!sd_match(SHLVal, m_BinOp(ISD::SHL, m_Value(), m_ConstInt(VShift))))
     return SDValue();
 
+  if (!SHLVal.hasOneUse())
----------------
mshockwave wrote:

could we fold this check into line 14887 with `m_OneUse`?

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


More information about the llvm-commits mailing list