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

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 02:52:35 PDT 2019


Orlando 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?


The middle block does the check for whether or not we need to run the remainder loop but also, for the bug [0], executes some operations to convert the result of the vectorized loop into a scalar value.

  middle.block:                                     ; preds = %vector.body.epil, %middle.block.unr-lcssa
    %.lcssa20 = phi <4 x i32> [ %.lcssa20.ph, %middle.block.unr-lcssa ], [ %33, %vector.body.epil ]
    %.lcssa = phi <4 x i32> [ %.lcssa.ph, %middle.block.unr-lcssa ], [ %34, %vector.body.epil 
    %bin.rdx = add <4 x i32> %.lcssa, %.lcssa20
    %rdx.shuf = shufflevector <4 x i32> %bin.rdx, <4 x i32> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
    %bin.rdx16 = add <4 x i32> %bin.rdx, %rdx.shuf
    %rdx.shuf17 = shufflevector <4 x i32> %bin.rdx16, <4 x i32> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
    %bin.rdx18 = add <4 x i32> %bin.rdx16, %rdx.shuf17
    %35 = extractelement <4 x i32> %bin.rdx18, i32 0
    %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
    br i1 %cmp.n, label %return, label %for.body.preheader19

[0] https://bugs.llvm.org/show_bug.cgi?id=39024


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

https://reviews.llvm.org/D60831





More information about the llvm-commits mailing list