[PATCH] Support using sample profiles with partial debug info.

Eric Christopher echristo at gmail.com
Tue Oct 21 15:41:21 PDT 2014


On Tue Oct 21 2014 at 3:39:09 PM David Blaikie <dblaikie at gmail.com> wrote:

> On Tue, Oct 21, 2014 at 3:31 PM, Diego Novillo <dnovillo at google.com>
> wrote:
>
>>
>>
>> On Tue, Oct 21, 2014 at 6:24 PM, David Blaikie <dblaikie at gmail.com>
>> wrote:
>>
>>> ================
>>> Comment at: lib/Transforms/Scalar/SampleProfile.cpp:647
>>> @@ -645,2 +646,3 @@
>>> +                                          const LLVMContext &Ctx) {
>>>    NamedMDNode *CUNodes = F.getParent()->getNamedMetadata("llvm.dbg.cu
>>> ");
>>>    if (CUNodes) {
>>> ----------------
>>> Why do we need this code at all? Should we just remove it in favor of
>>> the other code?
>>>
>>
>> I was actually going to ask you.  It seemed to me that this variant might
>> be slightly more efficient than the one that does not rely on llvm.dbg.cu
>> ?
>> (all the insn iteration, I mean).
>>
>
> Chances are you'll find it in the first handful of instructions (just past
> the prolog) and only have to iterate the entire contents of nodebug
> functions (unless anything's been inlined into them, in which case you'll
> be able to stop sooner). It may be less work than iterating through (N/2)
> subprograms.
>
>
>> If you don't  think that's the case, then it certainly is simpler if I
>> just remove it altogether.
>>
>
> Yeah, I'd kill it off unless we one day find this to be a real bottleneck
> in which case we can figure out how to make it better (probably by building
> the function->subprogram map once & keeping it around for use).
>

No objections here. I'd thought it would be a bit faster, but I also agree
with your idea for making it faster if we need to.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141021/ea76649c/attachment.html>


More information about the llvm-commits mailing list