llvm-project/llvm/lib/CodeGen/SelectionDAG
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
..
CMakeLists.txt Remove trailing whitespace to trigger re-cmaking 2017-10-02 21:54:38 +00:00
DAGCombiner.cpp [DAGCombiner] Fix SDLoc in a (zext (zextload x)) combine (4/N) 2018-05-01 19:51:15 +00:00
FastISel.cpp Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
FunctionLoweringInfo.cpp [AMDGPU] Fix issues for backend divergence tracking 2018-04-18 13:53:31 +00:00
InstrEmitter.cpp [SelectionDAG] Improve selection of DBG_VALUE using a PHI node result 2018-04-30 14:37:39 +00:00
InstrEmitter.h
LLVMBuild.txt
LegalizeDAG.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LegalizeFloatTypes.cpp [PowerPC][LegalizeFloatTypes] Move the PPC hacks for (i32 fp_to_sint/fp_to_uint (ppcf128 X)) out of LegalizeFloatTypes and into PPC specific code 2018-03-20 18:49:28 +00:00
LegalizeIntegerTypes.cpp [LegalizeTypes] Remove unnecessary type action check on the type of operand 0 when promoting shift result type. NFC 2018-04-12 06:51:58 +00:00
LegalizeTypes.cpp Remap values in PromotedFloats 2018-03-27 17:42:36 +00:00
LegalizeTypes.h [SelectionDAG] Don't promote mask operand when widening mstore and mscatter. 2017-12-05 23:08:30 +00:00
LegalizeTypesGeneric.cpp [SelectionDAG] Replace a std::vector<SDValue> with a SmallVector. 2018-01-26 07:15:22 +00:00
LegalizeVectorOps.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LegalizeVectorTypes.cpp [LegalizeTypes] In SplitVecOp_TruncateHelper, use GetSplitVector on the input instead of creating new extract_subvectors. 2018-03-13 01:17:40 +00:00
ResourcePriorityQueue.cpp Silence a bunch of implicit fallthrough warnings 2017-12-19 22:05:25 +00:00
SDNodeDbgValue.h [SelectionDAG] Improve selection of DBG_VALUE using a PHI node result 2018-04-30 14:37:39 +00:00
ScheduleDAGFast.cpp Add DBG_VALUE support to the linear DAG scheduler 2018-03-02 22:59:51 +00:00
ScheduleDAGRRList.cpp IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
ScheduleDAGSDNodes.cpp IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
ScheduleDAGSDNodes.h Fix layering of MachineValueType.h by moving it from CodeGen to Support 2018-03-23 23:58:25 +00:00
ScheduleDAGVLIW.cpp [CodeGen] Unify MBB reference format in both MIR and debug output 2017-12-04 17:18:51 +00:00
SelectionDAG.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
SelectionDAGAddressAnalysis.cpp [DAG] Teach findBaseOffset to interpret indexes of indexed memory operations 2018-01-26 16:51:27 +00:00
SelectionDAGBuilder.cpp Reapply "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)" 2018-05-03 17:04:16 +00:00
SelectionDAGBuilder.h Reapply "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)" 2018-05-03 17:04:16 +00:00
SelectionDAGDumper.cpp IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
SelectionDAGISel.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
SelectionDAGPrinter.cpp Remove redundant includes from lib/CodeGen. 2017-12-13 21:30:47 +00:00
SelectionDAGTargetInfo.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-13 21:15:20 +00:00
StatepointLowering.cpp Fix layering of MachineValueType.h by moving it from CodeGen to Support 2018-03-23 23:58:25 +00:00
StatepointLowering.h [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
TargetLowering.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00