[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
Tue Jul 14 07:38:41 PDT 2026


================
@@ -3543,6 +3543,39 @@ static ConstantInt *getKnownValueOnEdge(Value *V, BasicBlock *From,
   return nullptr;
 }
 
+static bool isUncontrolledConvergentCall(CallBase *CB) {
+  return CB->isConvergent() && !isa<ConvergenceControlInst>(CB) &&
+         !CB->getConvergenceControlToken();
+}
+
+static bool reachesUncontrolledConvergentCallBeforeBlock(BasicBlock *From,
+                                                         BasicBlock *StopBB) {
+  SmallVector<BasicBlock *, 8> Worklist;
----------------
shiltian wrote:

Are you suggesting that we should add a hook somewhere to indicate whether convergence is relevant for a target?

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


More information about the llvm-branch-commits mailing list