[PATCH] D61181: [WIP][DebugInfo] Avoid SelectionDAG un-necessarily debug-referring to dead VRegs

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 04:00:59 PDT 2019


jmorse created this revision.
jmorse added a reviewer: bjope.
Herald added subscribers: llvm-commits, kristof.beyls, javed.absar.
Herald added a project: LLVM.

[Not for review or submission yet, aim is to evaluate this first]

Hi Bjorn,

This patch hopefully alleviates some of the regressions seen with D56151 <https://reviews.llvm.org/D56151> / PR40010, where unfortunate DBG_VALUE creation by SelectionDAG generates debug uses of dead VRegs, that then get dropped later. More information on what's going on is in PR41583: this patch causes SelectionDAG to point/place DBG_VALUEs at the VReg/instruction where an exported Value is written to its long-term VReg, rather than where the Value is computed.

This isn't a panacea: fractionally more variable locations get dropped in a clang-3.4 build, largely because of long-term VRegs subsequently being optimised out by OptimizePHIs and similar passes. In effect this change would swap (assuming D56151 <https://reviews.llvm.org/D56151> is applied) locations dropped due to liveness issues, for locations dropped due to long-term VRegs being optimised out. (For me, the latter is more preferable).

There's the possibility that this won't resolve the regressions seen with D56151 <https://reviews.llvm.org/D56151> if the problem really hinges on register class copies: I haven't managed to replicate such a scenario on X86 or AArch64 as they have simple register hierarchies. The problem would be analogous (differences between value-computed and value-used VRegs and locations) but would be more unpleasent to solve.


Repository:
  rL LLVM

https://reviews.llvm.org/D61181

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61181.196824.patch
Type: text/x-patch
Size: 7420 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190426/6d51f7f6/attachment.bin>


More information about the llvm-commits mailing list