[PATCH] D38197: [DebugInfo] Sort the SDDbgValue list before assuming it is in IR order

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 05:04:03 PDT 2017


rnk created this revision.
Herald added subscribers: hiraditya, MatzeB.

This code iterates the 'Orders' vector in parallel with the DbgValue
list, emitting all DBG_VALUEs that occurred between the last IR order
insertion point and the next insertion point. This assumes the
SDDbgValue list is sorted in IR order, which it usually is. However, it
is not sorted when a node with a debug value is replaced with another
one. When this happens, TransferDbgValues is called, and the new value
is added to the end of the list.

The problem can be solved by stably sorting the list by IR order.


https://reviews.llvm.org/D38197

Files:
  llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
  llvm/test/CodeGen/X86/frame-lowering-debug-intrinsic-2.ll
  llvm/test/DebugInfo/X86/dbg-value-range.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38197.116415.patch
Type: text/x-patch
Size: 13690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170925/3a255b83/attachment.bin>


More information about the llvm-commits mailing list