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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 14 20:31:42 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;
----------------
dtcxzyw wrote:

Emm, I believe this pattern is unlikely to exist in real-world applications :(


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


More information about the llvm-commits mailing list