llvm-project/llvm/lib
Bjorn Pettersson 304877e5ec Reapply "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)"
Summary:
This reverts SVN r331441 (reapplies r331337), together with a fix
in to handle an already existing fragment expression in the
dbg.value that must be fragmented due to a split PHI node.

This should solve the problem seen in PR37321, which was the
reason for the revert of r331337.

The situation in PR37321 is that we have a PHI node like this

   %u.sroa = phi i80 [ %u.sroa.x, %if.x ],
                     [ %u.sroa.y, %if.y ],
                     [ %u.sroa.z, %if.z ]

and a dbg.value like this

  call void @llvm.dbg.value(metadata i80 %u.sroa,
                            metadata !13,
                            metadata !DIExpression(DW_OP_LLVM_fragment, 0, 80))

The phi node is split into three 32-bit PHI nodes

  %30:gr32 = PHI %11:gr32, %bb.4, %14:gr32, %bb.5, %27:gr32, %bb.8
  %31:gr32 = PHI %12:gr32, %bb.4, %15:gr32, %bb.5, %28:gr32, %bb.8
  %32:gr32 = PHI %13:gr32, %bb.4, %16:gr32, %bb.5, %29:gr32, %bb.8

but since the original value only is 80 bits we need to adjust the size
of the last fragment expression, and with this patch we get

  DBG_VALUE debug-use %30:gr32, debug-use $noreg, !"u", !DIExpression(DW_OP_LLVM_fragment, 0, 32)
  DBG_VALUE debug-use %31:gr32, debug-use $noreg, !"u", !DIExpression(DW_OP_LLVM_fragment, 32, 32)
  DBG_VALUE debug-use %32:gr32, debug-use $noreg, !"u", !DIExpression(DW_OP_LLVM_fragment, 64, 16)

Reviewers: vsk, aprantl, mstorsjo

Reviewed By: aprantl

Subscribers: llvm-commits

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

llvm-svn: 331464
2018-05-03 17:04:16 +00:00
..
Analysis Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
AsmParser Add the ShadowCallStack attribute 2018-04-03 20:10:40 +00:00
BinaryFormat Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
Bitcode Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
CodeGen Reapply "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)" 2018-05-03 17:04:16 +00:00
DebugInfo llvm-symbolizer: Handle function definitions nested within other functions 2018-05-01 18:08:45 +00:00
Demangle [demangler] Add a partial demangling API for LLDB. 2018-04-12 20:41:38 +00:00
ExecutionEngine Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
IR Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC [WebAssembly] MC: Create and use first class section symbols 2018-05-02 23:11:38 +00:00
Object IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
ObjectYAML Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Option IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
Passes Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ProfileData Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Support [Support] Support building LLVM for Fuchsia 2018-05-03 01:38:49 +00:00
TableGen [TableGen] Don't quote variable name when printing !foreach. 2018-05-02 13:17:26 +00:00
Target [X86] Split WriteVecALU/WritePHAdd into XMM and YMM/ZMM scheduler classes 2018-05-03 13:27:10 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode 2018-01-20 11:44:32 +00:00
Transforms perform DSE through launder.invariant.group 2018-05-03 11:03:53 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt