[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
Fri Jul 10 18:39:22 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:
I think it is not safe because a non-convergent function can have convergent operations.
https://github.com/llvm/llvm-project/pull/204958
More information about the llvm-branch-commits
mailing list