[llvm] [IndVarSimplify] Fix `IndVarSimplify` to skip on unfolding predicates when the loop contains control convergence operations. (PR #165643)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 30 02:00:59 PDT 2025


================
@@ -1859,6 +1859,37 @@ bool IndVarSimplify::predicateLoopExits(Loop *L, SCEVExpander &Rewriter) {
         }
       }
 
+  // If the loop body uses a convergence token defined within the loop, skip
+  // predication. This is to avoid changing the convergence behavior of the
+  // loop.
+  SmallVector<BasicBlock *, 16> blocks = ExitingBlocks;
----------------
nikic wrote:

Variables start with an uppercase letter.

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


More information about the llvm-commits mailing list