[llvm] [SimplifyCFG] Increase iterative simplification convergence limit. (PR #178406)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 03:53:20 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Marcos Maronas (maarquitos14)

<details>
<summary>Changes</summary>

https://github.com/llvm/llvm-project/commit/a9b0776a81e84d8042716863842fe1f8adf39cad added an assertion to avoid infinite loops. However, the limit seems arbitrary, there is no justification for it neither in the code nor in the commit message, so I think this can be increased.

---
Full diff: https://github.com/llvm/llvm-project/pull/178406.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 7ffccf73bd39d..edcdaea4c31da 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -244,7 +244,7 @@ static bool iterativelySimplifyCFG(Function &F, const TargetTransformInfo &TTI,
   unsigned IterCnt = 0;
   (void)IterCnt;
   while (LocalChange) {
-    assert(IterCnt++ < 1000 && "Iterative simplification didn't converge!");
+    assert(IterCnt++ < 2000 && "Iterative simplification didn't converge!");
     LocalChange = false;
 
     // Loop over all of the basic blocks and remove them if they are unneeded.

``````````

</details>


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


More information about the llvm-commits mailing list