[llvm] [LV] Use frozen start value for FindLastIV if needed. (PR #132691)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 06:20:57 PDT 2025


================
@@ -10377,6 +10380,36 @@ static void preparePlanForMainVectorLoop(VPlan &MainPlan, VPlan &EpiPlan) {
       VPInstruction::ResumePhi,
       {VectorTC, MainPlan.getCanonicalIV()->getStartValue()}, {},
       "vec.epilog.resume.val");
+
+  // When vectorizing the epilogue, FindLastIV reductions can introduce multiple
+  // uses of undef/poison. If the reduction start value is not guaranteed to be
----------------
fhahn wrote:

I update the comment to say `If the reduction start value may be undef or poison....`

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


More information about the llvm-commits mailing list