[PATCH] D60831: [DebugInfo at O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion

John Mellor-Crummey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 14:28:18 PDT 2019


jmellorcrummey added a comment.

In D60831#1470677 <https://reviews.llvm.org/D60831#1470677>, @hfinkel wrote:

> In D60831#1470585 <https://reviews.llvm.org/D60831#1470585>, @Orlando wrote:
>
> > In D60831#1470520 <https://reviews.llvm.org/D60831#1470520>, @hfinkel wrote:
> >
> > > How will this appear to profiling tools using PC sampling and using debug info to map the PC samples back to line numbers in the code?
> >
> >
> > I brought this up in some offline discussions which all concluded that the impact on profilers would be small and the trade off for better debugging is worth it. The impact on profilers seems like it would be small because the middle block is only visited once after running through the vectorized loop.
> >
> > I am glad you asked because this concern gives rise to an argument for giving the middle block instructions line 0 instead, and i am interested in hearing other's opinions.
>
>
> Interesting. The middle block just has the check for whether or not we need to run the remainder loop, right? I can definitely see this as kind of latch-like.
>
> @jmellorcrummey , do you have an opinion on this?


Unsurprisingly, I have an opinion :-).

As the lead of a project building profiling tools, I am strongly against having any instructions map to line 0.  Having address ranges without mappings completely distorts our view of the code and we have to add patches to cope with this case. All machine instructions should have a natural mapping if you put a bit of thought into it.

For instance, I sent comments back to IBM complaining about the lack of line mappings on machine instructions related to code generated for OpenMP offloading onto GPUs. Rather than having code intervals map to line 0, I advocated that they map boilerplate instructions back to the directive for which the code is being generated.

I strongly believe that instructions in what was described as the "middle block" above should map back to a plausible line. In the case of transformations such as common subexpression elimination that involve a one-to-many mapping, the mapping should be one of the lines where an operator appeared.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60831/new/

https://reviews.llvm.org/D60831





More information about the llvm-commits mailing list