[llvm] [LV] Use make_early_inc_range in handleFindLastReductions (PR #184340)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 07:19:28 PST 2026


================
@@ -1335,7 +1335,8 @@ bool VPlanTransforms::handleFindLastReductions(VPlan &Plan) {
   //   result = extract-last-active vp<new.data>, vp<new.mask>, ir<default.val>
 
   VPValue *HeaderMask = vputils::findHeaderMask(Plan);
-  for (auto &Phi : Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis()) {
+  for (auto &Phi : make_early_inc_range(
+           Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis())) {
----------------
fhahn wrote:

alternatively could also just insert the new PHI before the existing, but what would probably mean every test needs to be updated?

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


More information about the llvm-commits mailing list