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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 03:29:51 PST 2017


fhahn added a comment.

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

> Also, AFAIKS the outliner will (temporarily) generate invalid IR as the calls to the outlined function won't forward the vararg parameters. This is only "fixed" after inlining, when the va_start() and va_end() intrinsics again refer to the right function. While I don't feel we should "fix" this (e.g., by obtaining and forwarding the necessary parameters to the outlined function), we should certainly document this behavior.


Correct. I've added a comment to `doFunctionOutlining`, not sure if that is the right place. I think we would also have to ensure that `vaend` is also in the outlined function?



================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1494
+                          AAResults *CalleeAAR, bool InsertLifetime,
+                          Function *ForwardVarArgsTo) {
   Instruction *TheCall = CS.getInstruction();
----------------
grosser wrote:
> Document the new parameter?
Hm it looks like the same function is documented here and in include/llvm/Transforms/Utils/Cloning.h. The first 2 paragraphs match, but include/llvm/Transforms/Utils/Cloning.h contains additional info. According to [1], the doxygen comments for public functions should only be at the declaration.

[1] https://llvm.org/docs/CodingStandards.html#comment-formatting


https://reviews.llvm.org/D39607





More information about the llvm-commits mailing list