[llvm] [AMDGPU][FixIrreducible][UnifyLoopExits] Support callbr with inline-asm (PR #149308)
Robert Imschweiler via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 25 08:49:20 PDT 2025
================
@@ -186,11 +218,17 @@ static bool unifyLoopExits(DominatorTree &DT, LoopInfo &LI, Loop *L) {
L->verifyLoop();
// The guard blocks were created outside the loop, so they need to become
- // members of the parent loop.
+ // members of the parent loop. Same goes for the callbr target blocks if they
+ // have not already been added to the respective parent loop by adding them to
+ // the original callbr target's loop.
if (auto ParentLoop = L->getParentLoop()) {
for (auto *G : GuardBlocks) {
ParentLoop->addBasicBlockToLoop(G, LI);
}
+ for (auto *C : CallBrTargetBlocks) {
+ if (!ParentLoop->contains(C))
+ ParentLoop->addBasicBlockToLoop(C, LI);
----------------
ro-i wrote:
there are still situations in which we need to add to the parent block manually, see the new comments and the new test I added to `UnifyLoopExits/nested.ll`
https://github.com/llvm/llvm-project/pull/149308
More information about the llvm-commits
mailing list