[llvm] [VPlan] Add VPWidenInduction recipe as common base class (NFC). (PR #120008)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 12:50:31 PST 2024


================
@@ -10131,13 +10129,7 @@ preparePlanForEpilogueVectorLoop(VPlan &Plan, Loop *L,
     } else {
       // Retrieve the induction resume values for wide inductions from
       // their original phi nodes in the scalar loop.
-      PHINode *IndPhi = nullptr;
-      if (auto *Ind = dyn_cast<VPWidenPointerInductionRecipe>(&R)) {
-        IndPhi = cast<PHINode>(Ind->getUnderlyingValue());
-      } else {
-        auto *WidenInd = cast<VPWidenIntOrFpInductionRecipe>(&R);
-        IndPhi = WidenInd->getPHINode();
-      }
+      PHINode *IndPhi = dyn_cast<VPWidenInductionRecipe>(&R)->getPHINode();
----------------
fhahn wrote:

Done, thanks!

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


More information about the llvm-commits mailing list