llvm-project/llvm/test/DebugInfo/MIR/X86
Bjorn Pettersson 715a5efaad [DebugInfo] Do not extend range for physreg in LiveDebugVariables
Summary:
A DBG_VALUE that is referring to a physical register is
valid up until the next def of the register, or the end
of the basic block that it belongs to.

LiveDebugVariables is computing live intervals (slot index
ranges) for DBG_VALUE instructions, before regalloc, in order
to be able to re-insert DBG_VALUE instructions again after
regalloc. When the DBG_VALUE is mapping a variable to a
physical register we do not need to compute the range. We
should simply re-insert the DBG_VALUE at the start position.

The problem that was found, resulting in this patch, was a
situation when the DBG_VALUE was the last real use of the
physical register. The computeIntervals/extendDef methods
extended the range to cover the whole basic block, even though
the physical register very well could be allocated to some
virtual register inside the basic block. So the extended
range could not be trusted.

This patch is a preparation for https://reviews.llvm.org/D38229,
where the goal is to insert DBG_VALUE after each new definition
of a variable, even if the virtual registers that the variable
was connected to has been coalesced into using the same physical
register (e.g. due to two address instructions). For more info
see https://bugs.llvm.org/show_bug.cgi?id=34545

Reviewers: aprantl, rnk, echristo

Reviewed By: aprantl

Subscribers: Ka-Ka, llvm-commits

Differential Revision: https://reviews.llvm.org/D38140

llvm-svn: 314414
2017-09-28 13:10:06 +00:00
..
bit-piece-dh.mir llvm-dwarfdump: Make -brief the default and add a -verbose option instead. 2017-09-11 23:05:20 +00:00
empty-inline.mir [dwarfdump] Add verbose output for .debug-line section 2017-09-21 20:15:30 +00:00
lit.local.cfg Recommit LiveDebugValues pass after fixing a couple of minor issues. 2015-12-16 11:09:48 +00:00
live-debug-values-3preds.mir Parse and print DIExpressions inline to ease IR and MIR testing 2017-08-23 20:31:27 +00:00
live-debug-values-spill.mir Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
live-debug-values.mir Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
live-debug-vars-unused-arg-debugonly.mir [DebugInfo] Do not extend range for physreg in LiveDebugVariables 2017-09-28 13:10:06 +00:00
live-debug-vars-unused-arg.mir [DebugInfo] Do not extend range for physreg in LiveDebugVariables 2017-09-28 13:10:06 +00:00
livedebugvalues-limit.mir Parse and print DIExpressions inline to ease IR and MIR testing 2017-08-23 20:31:27 +00:00
mlicm-hoist.mir Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
no-cfi-loc.mir Recommit r288212: Emit 'no line' information for interesting 'orphan' instructions. 2016-12-12 20:49:11 +00:00