[llvm] [VPlan] Optimize FindLast of (binop %IV, live-in) by sinking. (PR #183911)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 07:04:19 PDT 2026


================
@@ -5819,14 +5907,14 @@ void VPlanTransforms::optimizeFindIVReductions(VPlan &Plan,
 
       VPBuilder LoopBuilder(BackedgeVal->getDefiningRecipe());
       VPValue *AnyOfCond = Cond;
-      if (TrueVal == PhiR)
+      if (OrigSelectR->getOperand(1) == PhiR)
----------------
ayalz wrote:

Independent: may be good to canonicalize Find Last Recurrence cycles in VPlan such that PhiR always feeds the FindLastSelect as its last operand, negating the Cond feeding it if needed.

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


More information about the llvm-commits mailing list