[llvm] [VPlan] Make simplifyRecipe more like InstCombine (PR #212968)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 03:52:10 PDT 2026


================
@@ -1659,7 +1618,16 @@ void VPlanTransforms::simplifyRecipes(VPlan &Plan) {
   for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
     for (VPRecipeBase &R : make_early_inc_range(*VPBB))
       if (auto *Def = dyn_cast<VPSingleDefRecipe>(&R))
-        simplifyRecipe(Def);
+        if (VPValue *New = simplifyRecipe(Def)) {
+          if (New != Def) {
+            // Replace the recipe with a new one.
+            Def->replaceAllUsesWith(New);
+            Def->eraseFromParent();
----------------
fhahn wrote:

with https://github.com/llvm/llvm-project/pull/212982, can we assert that the recipe we are removing does not have any side effects?

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


More information about the llvm-commits mailing list