[PATCH] D117509: [PartialInline] Bail out on asm-goto/callbr

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 10:58:11 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7cca13bc3a02: [PartialInline] Bail out on asm-goto/callbr (authored by wenlei).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117509/new/

https://reviews.llvm.org/D117509

Files:
  llvm/lib/Transforms/IPO/PartialInlining.cpp
  llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll


Index: llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll
===================================================================
--- llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll
+++ 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
 }
Index: llvm/lib/Transforms/IPO/PartialInlining.cpp
===================================================================
--- llvm/lib/Transforms/IPO/PartialInlining.cpp
+++ 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<BlockAddress>(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<BlockAddress>(User))
+      continue;
+
     CallBase *CB = getSupportedCallBase(User);
 
     if (isLimitReached())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117509.401338.patch
Type: text/x-patch
Size: 1539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220119/d9147ad9/attachment.bin>


More information about the llvm-commits mailing list