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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 02:56:25 PDT 2026


================
@@ -936,6 +936,20 @@ VPValue *VPSCEVExpander::expand(const SCEV *S) {
   }
   case scMulExpr: {
     auto *MulE = cast<SCEVMulExpr>(S);
+
+    // mul(PowerOf2C, udiv(X, PowerOf2C)) == (X >> C) << C -> X & (-1 << C),
+    // matching SCEVExpander::visitMulExpr.
+    const SCEVConstant *C1, *C2;
+    const SCEV *Val;
+    if (match(S, m_scev_Mul(m_SCEVConstant(C1),
----------------
fhahn wrote:

Yep I moved it to `simplifyRecipe`, thanks

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


More information about the llvm-commits mailing list