[PATCH] D106930: [ThinLTO] Disallow importing for functions with indir branch to block address

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 09:31:51 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/lib/Analysis/ModuleSummaryAnalysis.cpp:275
+      for (User *U : BlockAddress::get(const_cast<BasicBlock *>(&BB))->users())
+        if (!isa<CallBrInst>(*U)) {
+          HasIndirBranchToBlockAddress = true;
----------------
wmi wrote:
> wenlei wrote:
> > This logic is from InlineCost.cpp, but I'm not sure in what case do we have an indirect call to a block label? 
> Here is the only usage of CallBrInst in clang: https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGStmt.cpp#L2282, and it is used for gcc inline asm extension: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#GotoLabels 
> 
Ok, thanks for the pointer. In that case, I think it's indeed safe to allow CallBrInst to block address for inlining and importing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106930



More information about the llvm-commits mailing list