summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2017-10-02 12:46:32 +0000
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2017-10-02 12:46:32 +0000
commit839775a277b98f7fc2dce121a4634d0a33f5b394 (patch)
tree39f9ad2192f41ee165fd8972e8d23111e6eb5a0c /llvm/lib/CodeGen/SelectionDAG
parent4ee19603e920754788878cb424f2316525bca1b7 (diff)
downloadbcm5719-llvm-839775a277b98f7fc2dce121a4634d0a33f5b394.tar.gz
bcm5719-llvm-839775a277b98f7fc2dce121a4634d0a33f5b394.zip
[Debug info] Handle endianness when moving debug info for split integer values
Summary: Take the target's endianness into account when splitting the debug information in DAGTypeLegalizer::SetExpandedInteger. This patch fixes so that, for big-endian targets, the fragment expression corresponding to the high part of a split integer value is placed at offset 0, in order to correctly represent the memory address order. I have attached a PPC32 reproducer where the resulting DWARF pieces for a 64-bit integer were incorrectly reversed. Patch by: dstenb Reviewers: JDevlieghere, aprantl, dblaikie Reviewed By: JDevlieghere, aprantl, dblaikie Subscribers: nemanjai Differential Revision: https://reviews.llvm.org/D38172 llvm-svn: 314666
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index f76363adb99..f331fc7c250 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -864,8 +864,13 @@ void DAGTypeLegalizer::SetExpandedInteger(SDValue Op, SDValue Lo,
AnalyzeNewValue(Hi);
// Transfer debug values.
- transferDbgValues(DAG, Op, Lo, 0);
- transferDbgValues(DAG, Op, Hi, Lo.getValueSizeInBits());
+ if (DAG.getDataLayout().isBigEndian()) {
+ transferDbgValues(DAG, Op, Hi, 0);
+ transferDbgValues(DAG, Op, Lo, Hi.getValueSizeInBits());
+ } else {
+ transferDbgValues(DAG, Op, Lo, 0);
+ transferDbgValues(DAG, Op, Hi, Lo.getValueSizeInBits());
+ }
// Remember that this is the result of the node.
std::pair<SDValue, SDValue> &Entry = ExpandedIntegers[Op];
OpenPOWER on IntegriCloud