[llvm] [AMDGPU][FixIrreducible][UnifyLoopExits] Support callbr with inline-asm (PR #149308)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 20 23:19:09 PDT 2025


================
@@ -325,7 +402,7 @@ static bool FixIrreducibleImpl(Function &F, CycleInfo &CI, DominatorTree &DT,
   LLVM_DEBUG(dbgs() << "===== Fix irreducible control-flow in function: "
                     << F.getName() << "\n");
 
-  assert(hasOnlySimpleTerminator(F) && "Unsupported block terminator.");
+  assert(hasOnlySimpleTerminatorOrCallBr(F) && "Unsupported block terminator.");
----------------
ssahasra wrote:

> Only if those blocks are processed while dealing with a loop/cycle. However, they wouldn't actually be a problem if used completely unrelated to any loop/cycle. Ig that it's more for documenting the restriction of the pass inside the code as well.

Then removing this assert will allow the pass to run (correctly) on some functions that are currently rejected, right? That assert was written long ago when we were still new to all this work and we wanted to advertize our limitation as loudly as possible. If later asserts in the code will catch unsupported terminators only where they matter, then I think it's worth it to remove this assert.

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


More information about the llvm-commits mailing list