diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp --- a/llvm/lib/Transforms/IPO/PartialInlining.cpp +++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp @@ -970,6 +970,9 @@ }; for (User *User : Users) { + // Don't bother with BlockAddress used by CallBr for asm goto. + if (isa(User)) + continue; CallBase *CB = getSupportedCallBase(User); Function *Caller = CB->getCaller(); if (CurrentCaller != Caller) { @@ -1413,6 +1416,10 @@ bool AnyInline = false; for (User *User : Users) { + // Don't bother with BlockAddress used by CallBr for asm goto. + if (isa(User)) + continue; + CallBase *CB = getSupportedCallBase(User); if (isLimitReached()) diff --git a/llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll b/llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll --- a/llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll +++ b/llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll @@ -101,6 +101,12 @@ br label %for.cond2 for.end: ; preds = %for.cond2 + callbr void asm sideeffect "1: nop\0A\09.quad b, ${0:l}, $$5\0A\09", "X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@bar, %l_yes)) + to label %asm.fallthrough [label %l_yes] +asm.fallthrough: ; preds = %for.end + br label %l_yes + +l_yes: %20 = load i32, i32* %sum, align 4 ret i32 %20 }