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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 15:13:02 PST 2026


================
@@ -5770,8 +5822,15 @@ void VPlanTransforms::optimizeFindIVReductions(VPlan &Plan,
       VPValue *Sentinel = Plan.getConstantInt(*SentinelVal);
       auto *Cmp = MiddleBuilder.createICmp(CmpInst::ICMP_NE, ReducedIV,
                                            Sentinel, ExitDL);
+
+      // If IV was an expression, sink the expression to the middle block.
+      VPValue *ResultVal = ReducedIV;
----------------
fhahn wrote:

Updated thanks!

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


More information about the llvm-commits mailing list