[llvm] [VPlan] Remove VPVectorPointer for part 0 after unrolling. (PR #149735)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 03:12:33 PDT 2025


================
@@ -1015,6 +1015,12 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
     if (Op->isLiveIn())
       PredPHI->replaceAllUsesWith(Op);
   }
+  if (auto *VecPtr = dyn_cast<VPVectorPointerRecipe>(&R)) {
+    if (VecPtr->getParent()->getPlan()->isUnrolled() && VecPtr->isPart0()) {
----------------
fhahn wrote:

We can only rely on `isPart0` after the plan has been unrolled. Before unrolling, all `VPVectorPointerRecipes` will be 'part 0', but we cannot remove them. 

I moved this down to the bottom of `simplifyRecipe` where we already perform simplifications that are only valid after unrolling. So no extra check is needed.

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


More information about the llvm-commits mailing list