[PATCH] D39607: [PartialInliner] Inline vararg functions that forward varargs.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 04:09:42 PST 2017


fhahn added a comment.

In https://reviews.llvm.org/D39607#917790, @grosser wrote:

> Officially accept this revision. From my perspective this looks good.
>
> Do you have some other partial inliner person who could give some additional feedback?


I think it would be great if either @davidxl or @davide could sign-off on this.



================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:830
+  // cleanup if we find vastart.
+  if (ClonedFunc->isVarArg() && OutlinedFunc)
+    for (auto &BB : *ClonedFunc)
----------------
davidxl wrote:
> Is it possible to teach code extractor to handle this and return null instead of doing the cleanup here?  CodeExtractor knows the set of blocks to be extracted or not.
Yes I moved the code to the beginning of `extractCodeRegion`, before anything is modified. I could not find a place were CodeExtractor already iterates over the set of blocks not the be extracted, so it is iterating over the basic blocks of the original function and excludes blocks to be extracted.


https://reviews.llvm.org/D39607





More information about the llvm-commits mailing list