[llvm] [VPlan] Optimize FindLast of FindIV w/o sentinel. (PR #172569)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 10:52:36 PST 2026


================
@@ -5526,36 +5526,83 @@ void VPlanTransforms::optimizeFindIVReductions(VPlan &Plan,
         CheckSentinel(IVSCEV, UseMax, /*IsSigned=*/true);
     if (!SentinelVal) {
       SentinelVal = CheckSentinel(IVSCEV, UseMax, /*IsSigned=*/false);
-      if (!SentinelVal)
-        continue;
       UseSigned = false;
     }
 
-    auto *RdxResult = cast<VPInstruction>(vputils::findRecipe(
+    // Fall back to boolean tracking if IV doesn't wrap.
----------------
fhahn wrote:

Thanks, added a bit more detail

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


More information about the llvm-commits mailing list