[llvm] [AMDGPU][FixIrreducible][UnifyLoopExits] Support callbr with inline-asm (PR #149308)
Robert Imschweiler via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 21 02:35:44 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:
not really: if LI is updated, the new intermediate callbr target block is added to the loop of the original callbr target. This is not the loop of the callbr block itself. But these two loops may still have common parent loops. So the information that the intermediate callbr target block had been added to the original callbr target block's loop does not really improve the situation, I think (?)
https://github.com/llvm/llvm-project/pull/149308
More information about the llvm-commits
mailing list