[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
Wed Apr 17 10:14:45 PDT 2019


Orlando created this revision.
Orlando added reviewers: samsonov, vsk, aprantl, probinson.
Orlando added projects: LLVM, debug-info.
Herald added subscribers: llvm-commits, zzheng, hiraditya.

Bug: https://bugs.llvm.org/show_bug.cgi?id=39024

The bug reports that a vectorized loop is stepped through 4 times and each step through the loop seemed to show a different path. I found two problems here:

A) An incorrect line number on a preheader block (for.body.preheader) instruction causes a step into the loop before it begins.
B) Instructions in the middle block have different line numbers which give the impression of another iteration.

In this patch I give all of the middle block instructions the line number of the scalar loop latch terminator branch. This seems to provide the smoothest debugging experience because the vectorized loops will always end on this line before dropping into the scalar loop. To solve problem A I have altered llvm::SplitBlockPredecessors to accommodate for loop header blocks.


Repository:
  rL LLVM

https://reviews.llvm.org/D60831

Files:
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopSimplify/dbg-loc.ll
  llvm/test/Transforms/LoopSimplify/do-preheader-dbg.ll
  llvm/test/Transforms/LoopSimplify/for-preheader-dbg.ll
  llvm/test/Transforms/LoopUnroll/runtime-loop1.ll
  llvm/test/Transforms/LoopVectorize/debugloc.ll
  llvm/test/Transforms/LoopVectorize/fix-reduction-dbg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60831.195583.patch
Type: text/x-patch
Size: 22507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190417/87d42cdc/attachment.bin>


More information about the llvm-commits mailing list