Fixed potential bug if the source and target of a bit convert have different alignment
authorMon P Wang <wangmp@apple.com>
Tue, 15 Jul 2008 05:28:34 +0000 (05:28 +0000)
committerMon P Wang <wangmp@apple.com>
Tue, 15 Jul 2008 05:28:34 +0000 (05:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53590 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 632653b624da481e1aa4489e4e90109048eda7fc..4b9236db4677d43c7fb912ca631e3b1388e8207c 100644 (file)
@@ -7015,7 +7015,9 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
       // The input is a scalar or single-element vector.
       // Lower to a store/load so that it can be split.
       // FIXME: this could be improved probably.
-      SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType());
+      unsigned LdAlign = TLI.getTargetData()->getPrefTypeAlignment(
+                                            Op.getValueType().getTypeForMVT());
+      SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType(), LdAlign);
       int FI = cast<FrameIndexSDNode>(Ptr.Val)->getIndex();
 
       SDOperand St = DAG.getStore(DAG.getEntryNode(),