[llvm] [VPlan] Model first memory runtime checks as VPlan recipes. (PR #221483)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 15:47:51 PDT 2026


================
@@ -1541,6 +1541,14 @@ static VPSingleDefRecipe *combineRecipe(VPlan &Plan, VPSingleDefRecipe *Def) {
         {X, Plan.getConstantInt(APC->getBitWidth(), APC->exactLogBase2())},
         *cast<VPRecipeWithIRFlags>(Def), Def->getDebugLoc());
 
+  // (X >> C) << C -> X & (-1 << C).
+  if (CanCreateNewRecipe &&
+      match(Def, m_Shl(m_LShr(m_VPValue(X), m_VPValue(Y, m_APInt(APC))),
+                       m_Deferred(Y))))
+    return Builder.createAnd(
+        X, Plan.getConstantInt(APInt::getAllOnes(APC->getBitWidth()) << *APC),
+        Def->getDebugLoc());
----------------
artagnon wrote:

Can this be landed separately? Do we get any diff?

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


More information about the llvm-commits mailing list