[PATCH] D58260: [INLINER] allow inlining of address taken blocks

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 15 15:10:44 PST 2019


nickdesaulniers marked 3 inline comments as done.
nickdesaulniers added inline comments.


================
Comment at: llvm/lib/IR/BasicBlock.cpp:445
 
+bool BasicBlock::addressPotentiallyEscapesFunction() {
+  for (const Use& U : BlockAddress::get(this)->uses())
----------------
jyknight wrote:
> This will need to use a worklist loop, to handle a few kinds of uses. Something like this:
> 1. If the use isa<Constant> && !isa<GlobalValue> (most particularly to handle a pointer bitcast): add all the uses of _that_ to the worklist to check.
> 2. Call with nocapture attribute -> OK, keep checking.
> 3. Anything else -> potentially escapes, return true.
Ok, I tried to codify this description (thanks for it, and the help so far).  It seems to work for my simplistic test case, but I'm still reading through the LangRef furiously while trying to write up a few test cases.

Transforms/Inline/blockaddress.ll still crashes, but maybe I can look into that last; once I have some added unit tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58260





More information about the llvm-commits mailing list