[llvm-branch-commits] [llvm] [SimplifyCFG] Do not thread branches into uncontrolled convergent regions (PR #204958)

Shilei Tian via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 22 06:24:25 PDT 2026


================
@@ -3619,6 +3673,14 @@ foldCondBranchOnValueKnownInPredecessorImpl(CondBrInst *BI, DomTreeUpdater *DTU,
     if (ReachesNonLocalUseBlocks.contains(RealDest))
       continue;
 
+    // Threading through a branch can bypass a reconvergence point. If the
+    // destination can execute an uncontrolled convergent operation before
+    // returning to this block, this may change the dynamic instance of that
+    // operation.
+    if (TTI.hasBranchDivergence(BB->getParent()) &&
----------------
shiltian wrote:

I think that would be a separate change.

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


More information about the llvm-branch-commits mailing list