[PATCH] D64033: Add column info for inline sites

Wenlei He via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 21:24:03 PDT 2019


Yeah, discriminators would be perfect here like its AutoFDO usage, except
that in our case, we want to be able to map it to "actual" source (column)
location.

On Mon, Jul 15, 2019 at 8:43 PM Eric Christopher <echristo at gmail.com> wrote:

> Further, this is why discriminators were created and can be used here.
>
> On Mon, Jul 15, 2019, 8:14 PM David Blaikie via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> dblaikie added a comment.
>>
>> In D64033#1586885 <https://reviews.llvm.org/D64033#1586885>, @wenlei
>> wrote:
>>
>> > In D64033#1586625 <https://reviews.llvm.org/D64033#1586625>, @dblaikie
>> wrote:
>> >
>> > > What's the motivation for this?
>> >
>> >
>> > We need to differentiate inline sites on the same line for an internal
>> (basically the tool needs to annotate each instruction with stack of inline
>> site locations). And the missing column info for inline sites gets in the
>> way. I thought the change will be helpful to others as well..
>>
>>
>> For what it's worth, this still won't disambiguate all inline calls (LLVM
>> used to try to use this technique to disambiguate instructions from two
>> different inlined calls & it would fail sometimes even after we forced
>> column info on to help), in this sort of situation:
>>
>>   #define FOO x(); x()
>>   void x();
>>   int main() {
>>     FOO;
>>   }
>>
>> Both calls to 'x' will be attributed to the location of the FOO usage,
>> line 4 column 3.
>>
>> >
>> >
>> >> Should it be conditional on "-gcolumn-info"? (or skipping it in
>> general if the column is zero? that'd make "-gno-column-info" fall out
>> naturally)
>> >>  (we don't put decl_column on subprogram DIEs, for instance -
>> admittedly, it's more likely the same function could have multiple inline
>> call sites on the same line than you'd have multiple functions defined on
>> the same line)
>> >
>> > Good point. Thanks David. I will send a separate patch to skip zero
>> column so we won't have column when "-gno-column-info" is used.
>>
>> Cool cool - thanks!
>>
>>
>> Repository:
>>   rL LLVM
>>
>> CHANGES SINCE LAST ACTION
>>   https://reviews.llvm.org/D64033/new/
>>
>> https://reviews.llvm.org/D64033
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190715/ce050c72/attachment.html>


More information about the llvm-commits mailing list