[llvm] [VPlan] Introduce explicit ExtractFromEnd recipes for live-outs. (PR #100658)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 10 13:02:16 PDT 2024


================
@@ -8470,22 +8480,29 @@ static void addUsersInExitBlock(
     // live-outs.
     if ((isa<VPWidenIntOrFpInductionRecipe>(V) &&
          !cast<VPWidenIntOrFpInductionRecipe>(V)->getTruncInst()) ||
-        isa<VPWidenPointerInductionRecipe>(V) ||
+        isa<VPWidenPointerInductionRecipe, VPFirstOrderRecurrencePHIRecipe>(
+            V) ||
         (isa<Instruction>(IncomingValue) &&
          any_of(IncomingValue->users(), [&Inductions](User *U) {
            auto *P = dyn_cast<PHINode>(U);
            return P && Inductions.contains(P);
          })))
       continue;
-    Plan.addLiveOut(&ExitPhi, V);
+
+    VPValue *Ext = B.createNaryOp(
+        VPInstruction::ExtractFromEnd,
+        {V, Plan.getOrAddLiveIn(ConstantInt::get(
----------------
ayalz wrote:

Independently: may be good to provide VPlan::getOrAddConstant(), with type derived somehows.

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


More information about the llvm-commits mailing list