[llvm] [VPlan] Transform VPFirstOrderRecurrencePHIRecipe into concrete recipes (PR #172009)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 14 01:51:01 PST 2025


================
@@ -3695,6 +3695,34 @@ void VPlanTransforms::convertToConcreteRecipes(VPlan &Plan) {
         continue;
       }
 
+      if (auto *FORPhiR = dyn_cast<VPFirstOrderRecurrencePHIRecipe>(&R)) {
+        VPValue *InitVec = FORPhiR->getStartValue();
+        DebugLoc DL = FORPhiR->getDebugLoc();
+        if (VF.isVector()) {
+          VPBuilder PHBuilder(Plan.getVectorPreheader());
+          VPValue *Poison = Plan.getOrAddLiveIn(
+              PoisonValue::get(TypeInfo.inferScalarType(InitVec)));
+          Type *IdxTy = Type::getInt32Ty(Plan.getContext());
----------------
artagnon wrote:

Hm, insertelement must take i32 type, so this hard-coding is the right thing to do?

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


More information about the llvm-commits mailing list