aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-07-10 15:26:17 +0000
committerDuncan Sands <baldrick@free.fr>2008-07-10 15:26:17 +0000
commitc5ffb45934a5f6c19b6279a42622f1b4d9e7ec88 (patch)
tree6fa19ecba09708dad98c995e8d32f5b8edc4fea6 /lib
parentf4e4629ee8c218f892ad8ae3e182fe40bc160895 (diff)
downloadexternal_llvm-c5ffb45934a5f6c19b6279a42622f1b4d9e7ec88.zip
external_llvm-c5ffb45934a5f6c19b6279a42622f1b4d9e7ec88.tar.gz
external_llvm-c5ffb45934a5f6c19b6279a42622f1b4d9e7ec88.tar.bz2
Make sure the alignment of the temporary created
in CreateStackStoreLoad is good enough for both the source and destination types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index ed09c6b..7a0a52d 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -16,6 +16,7 @@
#include "LegalizeTypes.h"
#include "llvm/CallingConv.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Target/TargetData.h"
using namespace llvm;
#ifndef NDEBUG
@@ -547,8 +548,11 @@ SDOperand DAGTypeLegalizer::BitConvertToInteger(SDOperand Op) {
SDOperand DAGTypeLegalizer::CreateStackStoreLoad(SDOperand Op,
MVT DestVT) {
- // Create the stack frame object.
- SDOperand FIPtr = DAG.CreateStackTemporary(DestVT);
+ // Create the stack frame object. Make sure it is aligned for both
+ // the source and destination types.
+ unsigned SrcAlign =
+ TLI.getTargetData()->getPrefTypeAlignment(Op.getValueType().getTypeForMVT());
+ SDOperand FIPtr = DAG.CreateStackTemporary(DestVT, SrcAlign);
// Emit a store to the stack slot.
SDOperand Store = DAG.getStore(DAG.getEntryNode(), Op, FIPtr, NULL, 0);