diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-16 18:25:36 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-16 18:25:36 +0000 |
commit | 905ff1ebc4f383088e6af6fc37504cd06ba62b57 (patch) | |
tree | b5075cce66cc7b22c3a7bfb0a6afc891fb9a72d3 /lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | |
parent | 09dc9c0c8363a689aa5559ae0e3ac33e381c2bb2 (diff) | |
download | external_llvm-905ff1ebc4f383088e6af6fc37504cd06ba62b57.zip external_llvm-905ff1ebc4f383088e6af6fc37504cd06ba62b57.tar.gz external_llvm-905ff1ebc4f383088e6af6fc37504cd06ba62b57.tar.bz2 |
Preserve SourceValue information when lowering produces multiple loads from
different offsets within the same stack slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp index 91fd589..fb86875 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp @@ -19,6 +19,7 @@ #include "LegalizeTypes.h" #include "llvm/Target/TargetData.h" +#include "llvm/CodeGen/PseudoSourceValue.h" using namespace llvm; //===----------------------------------------------------------------------===// @@ -83,12 +84,14 @@ void DAGTypeLegalizer::ExpandRes_BIT_CONVERT(SDNode *N, SDValue &Lo, unsigned Alignment = TLI.getTargetData()->getPrefTypeAlignment(NOutVT.getTypeForMVT()); SDValue StackPtr = DAG.CreateStackTemporary(InVT, Alignment); + int SPFI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex(); + const Value *SV = PseudoSourceValue::getFixedStack(SPFI); // Emit a store to the stack slot. - SDValue Store = DAG.getStore(DAG.getEntryNode(), InOp, StackPtr, NULL, 0); + SDValue Store = DAG.getStore(DAG.getEntryNode(), InOp, StackPtr, SV, 0); // Load the first half from the stack slot. - Lo = DAG.getLoad(NOutVT, Store, StackPtr, NULL, 0); + Lo = DAG.getLoad(NOutVT, Store, StackPtr, SV, 0); // Increment the pointer to the other half. unsigned IncrementSize = NOutVT.getSizeInBits() / 8; @@ -96,7 +99,7 @@ void DAGTypeLegalizer::ExpandRes_BIT_CONVERT(SDNode *N, SDValue &Lo, DAG.getIntPtrConstant(IncrementSize)); // Load the second half from the stack slot. - Hi = DAG.getLoad(NOutVT, Store, StackPtr, NULL, 0, false, + Hi = DAG.getLoad(NOutVT, Store, StackPtr, SV, IncrementSize, false, MinAlign(Alignment, IncrementSize)); // Handle endianness of the load. |