[llvm] [VPlan] Simplify PredPHI LiveIn -> LiveIn (PR #142271)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 1 14:37:39 PDT 2025


================
@@ -1011,14 +1011,12 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
           .Default([](auto *) { return false; }))
     return;
 
-  // Fold PredPHI constant -> constant.
+  // Fold PredPHI LiveIn -> LiveIn.
   if (auto *PredPHI = dyn_cast<VPPredInstPHIRecipe>(&R)) {
-    VPlan *Plan = R.getParent()->getPlan();
     VPValue *Op = PredPHI->getOperand(0);
     if (!Op->isLiveIn() || !Op->getLiveInIRValue())
----------------
fhahn wrote:

```suggestion
    if (!Op->isLiveIn())
```

I think there isn't any need to limit this to live-in IR values now (there are a few symbolic live-ins w/o underlying IR value), those should be fine here. Those probably aren't used by PredPhis, so likely not test-able.

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


More information about the llvm-commits mailing list