[llvm] [AMDGPU] Don't unify divergent exit nodes with `musttail` calls (PR #126395)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 9 07:01:36 PST 2025


================
@@ -215,7 +215,10 @@ bool AMDGPUUnifyDivergentExitNodesImpl::run(Function &F, DominatorTree *DT,
       PDT.roots(), [&](auto BB) { return !isUniformlyReached(UA, *BB); });
 
   for (BasicBlock *BB : PDT.roots()) {
-    if (isa<ReturnInst>(BB->getTerminator())) {
+    if (auto *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
+      auto *CI = dyn_cast_or_null<CallInst>(RI->getPrevNode());
----------------
shiltian wrote:

[Yes](https://llvm.org/docs/LangRef.html#call-instruction)

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


More information about the llvm-commits mailing list