[llvm] [InstCombine] Fold `(shl ShVal, (X + 1) & (Width-1)) | (lshr ShVal, (X & Width-1) ^ (Width-1))` --> `fshl(ShVal, ShVal, X+1)` (PR #214035)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 10:15:09 PDT 2026


================
@@ -3013,6 +3013,17 @@ InstCombinerImpl::convertOrOfShiftsToFunnelShift(Instruction &Or) {
           match(R, m_And(m_Neg(m_Specific(X)), m_SpecificInt(Mask))))
         return X;
 
+      // (shl ShVal,(X+1) & (Width-1)) | (lshr ShVal,((X & (Width-1)) ^
+      // (Width-1)))
+      {
+        Value *ShAmt = nullptr;
----------------
VachanVY wrote:

ok

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


More information about the llvm-commits mailing list