[llvm] VPlan: introduce worklist in simplifyRecipes (PR #105699)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 07:12:06 PDT 2024


================
@@ -1009,8 +1015,16 @@ static void simplifyRecipes(VPlan &Plan, LLVMContext &Ctx) {
       Plan.getEntry());
   VPTypeAnalysis TypeInfo(Plan.getCanonicalIV()->getScalarType(), Ctx);
   for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
-    for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
-      simplifyRecipe(R, TypeInfo);
+    // Populate a Worklist, as simplifyRecipe might return a new recipe that we
----------------
artagnon wrote:

Actually, if you see #93398, `simplifyRecipe` creates two new recipes in one instance: even if only one NewR replaces all of R's uses, doesn't `simplifyRecipe` match the root recipe, and not sub-recipes? The order in which recipes are simplified should not matter, I think.

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


More information about the llvm-commits mailing list