<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 12, 2014 at 2:02 AM,  <span dir="ltr"><<a href="mailto:llvm@dyatkovskiy.com" target="_blank">llvm@dyatkovskiy.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
After merging we always remove body of "G" (function we want to merge with "existing" one).<br>
In case with "writeThunk" we could add such info for "G", but it would be just a single string: reference to first string of "G".<br></blockquote><div><br></div><div>I don't think that's completely unreasonable - actually it's probably about the most right thing we can do (in this way the user would've seen "caller -> G -> etc... " and will now see "caller -> G -> F -> etc..." which might be a bit confusing, but that's the nature of optimization, really).<br><br>Do you have a small C++/clang example of function merging firing, and using a thunk?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ideal way here, is to merge debug information itself, and provide "F" with information for "G" and "F", but I think it's unreal :-( Since debugger should check function name it entered, and then filter such debug information with this name. Though I'm not that familiar with Debug Info, perhaps there are still possible ways to provide single body with two debug infos.<br></blockquote><div><br></div><div>Yeah, I suspect we'd confuse debug info consumers if we produced two function descriptions describing the same function... for a bunch of reasons (& adding the plumbing to do that in LLVM's debug info emission wouldn't be easy either) so I'll probably leave that alone for now.<br><br>- David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-Stepan<br>
<br>
08.10.2014, 00:32, "Stepan Dyatkovskiy" <<a href="mailto:stpworld@narod.ru">stpworld@narod.ru</a>>:<br>
<div><div class="h5">> Hi David,<br>
> Thanks for attention to MergeFunctions! I have read your mail briefly,<br>
> tomorrow I'll provide you with detailed information. By now you could<br>
> use tests from  $LLVM/test/Transforms/MergeFunc/ as examples.<br>
><br>
> Cheers!<br>
> -Stepan<br>
><br>
> David Blaikie wrote:<br>
>>  Hi Stepan,<br>
>><br>
>>  After discovering several bugs in ArgumentPromotion and<br>
>>  DeadArgumentElimination where llvm::Functions were replaced with similar<br>
>>  functions (with the same name) to transform their type in some way, I<br>
>>  started looking at all calls to llvm::Function::takeName to see if there<br>
>>  were any other debug info quality bugs in similar callers.<br>
>><br>
>>  One such caller is MergeFunctions, and I don't see any debug info tests<br>
>>  for this so I'm wondering what /should/ happen here.<br>
>><br>
>>  In the case where the functions are internal I'm not sure there's<br>
>>  anything we can do, we simply remove one function and keep the other -<br>
>>  the debug info can only be ascribed to one of the two and this probably<br>
>>  comes out naturally (whichever name we choose to keep). I don't think we<br>
>>  can have the debug info for one function reference a global alias, while<br>
>>  the debug info for another function references the thing that alias<br>
>>  refers to. So be it.<br>
>><br>
>>  But in the case of MergeFunctions::writeThunk we can probably do better<br>
>>  - by updating the debug info for the thunk'd function so we at least<br>
>>  describe this trivial function in the debug info.<br>
>><br>
>>  Does that sound about right?<br>
>><br>
>>  Could you provide any C/C++ source examples where MergeFunctions fires<br>
>>  fairly reliably so I could play around with the debug info behavior (&<br>
>>  fixes) here?<br>
>><br>
>>  Thanks,<br>
>>  - David<br>
><br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>