[llvm] [InstCombine] Recognize more rotation patterns (PR #78107)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 01:57:35 PST 2024


================
@@ -2809,6 +2809,10 @@ static Instruction *matchFunnelShift(Instruction &Or, InstCombinerImpl &IC,
           match(R, m_And(m_Neg(m_Specific(X)), m_SpecificInt(Mask))))
         return X;
 
+      // (shl ShVal, X) | (lshr ShVal, ((-X) & (Width - 1)))
+      if (match(R, m_And(m_Neg(m_Specific(L)), m_SpecificInt(Mask))))
+        return L;
----------------
nikic wrote:

@dtcxzyw I agree with you.


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


More information about the llvm-commits mailing list