[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
Tue May 14 08:19:07 PDT 2019


Orlando updated this revision to Diff 199443.
Orlando added a comment.
Herald added subscribers: eraman, javed.absar.

This update addresses the problems with the original patch that caused the built bot failures
(sorry about that!).

The original patch fixed SplitBlockPredecessors(..) so that when splitting a loop header
the new preheader was assigned the DebugLoc of the start of the loop. The DebugLoc
was determined by calling  Loop::getStartLoc(), which relies on loop metadata (MD_Loop).

Currently, when inlining a loop, the loop metadata is cloned without modification. This means
that the loop metadata "start" and "end" locations refer to the locations in the cloned function.
I.e. The fact that the loop has been inlined is ignored in the loop metadata.

This update copies and then modifies the loop metadata during inlining such that the "start" and
 "end" DILocations include "inlinedAt" metadata.

There have been a few very minor changes to the original patch, so the files of interest are:
"InlineFunction.cpp", "inlined-loop-metadata.ll",  "inlined-argument.ll", "bcmp-debugify-remarks.ll"

A new regression test "inlined-loop-metadata.ll" covers the loop metadata problem.
"bcmp-debugify-remarks.ll" and "inlined-argument.ll" needed to be updated
because they rely on the old incorrect metadata.

Thank you,
Orlando


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

https://reviews.llvm.org/D60831

Files:
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/DebugInfo/AArch64/inlined-argument.ll
  llvm/test/Transforms/Inline/inlined-loop-metadata.ll
  llvm/test/Transforms/LoopIdiom/bcmp-debugify-remarks.ll
  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/X86/vectorization-remarks-missed.ll
  llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-profitable.ll
  llvm/test/Transforms/LoopVectorize/debugloc.ll
  llvm/test/Transforms/LoopVectorize/fix-reduction-dbg.ll
  llvm/test/Transforms/LoopVectorize/unsafe-dep-remark.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60831.199443.patch
Type: text/x-patch
Size: 54019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190514/27678048/attachment.bin>


More information about the llvm-commits mailing list