[llvm] [LV] Use getDecisionRangeAndClamp for IVUpdateMayOverflow (PR #156028)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 29 07:11:55 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Ramkumar Ramachandra (artagnon)
<details>
<summary>Changes</summary>
The change is very difficult to test.
---
Full diff: https://github.com/llvm/llvm-project/pull/156028.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+5-8)
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 6317bc3c20e25..5dfcd26e882d4 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8567,14 +8567,11 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
VPlanTransforms::createLoopRegions(*Plan);
- // Don't use getDecisionAndClampRange here, because we don't know the UF
- // so this function is better to be conservative, rather than to split
- // it up into different VPlans.
- // TODO: Consider using getDecisionAndClampRange here to split up VPlans.
- bool IVUpdateMayOverflow = false;
- for (ElementCount VF : Range)
- IVUpdateMayOverflow |= !isIndvarOverflowCheckKnownFalse(&CM, VF);
-
+ bool IVUpdateMayOverflow = LoopVectorizationPlanner::getDecisionAndClampRange(
+ [this](ElementCount VF) {
+ return !isIndvarOverflowCheckKnownFalse(&CM, VF);
+ },
+ Range);
TailFoldingStyle Style = CM.getTailFoldingStyle(IVUpdateMayOverflow);
// Use NUW for the induction increment if we proved that it won't overflow in
// the vector loop or when not folding the tail. In the later case, we know
``````````
</details>
https://github.com/llvm/llvm-project/pull/156028
More information about the llvm-commits
mailing list