[llvm] [LV] Keep predicate select when optimizeFindIVReductions when folding tail. (PR #191166)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 17:54:00 PDT 2026


================
@@ -5902,6 +5904,10 @@ void VPlanTransforms::optimizeFindIVReductions(VPlan &Plan,
       }
     }
 
+    // Update the predicated select with FindLastSelect when folding tail.
+    if (HeaderMask)
+      PredSelect->setOperand(1, FindLastSelect);
----------------
ElvisWang123 wrote:

Updated to LogicalAnd approach, thanks!

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


More information about the llvm-commits mailing list