add support for alignment attributes on load/store instructions

llvm-svn: 36301
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index e009488..f2833c7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -498,7 +498,7 @@
 
   SDOperand getLoadFrom(const Type *Ty, SDOperand Ptr,
                         const Value *SV, SDOperand Root,
-                        bool isVolatile);
+                        bool isVolatile, unsigned Alignment);
 
   SDOperand getIntPtrConstant(uint64_t Val) {
     return DAG.getConstant(Val, TLI.getPointerTy());
@@ -2313,19 +2313,21 @@
   }
 
   setValue(&I, getLoadFrom(I.getType(), Ptr, I.getOperand(0),
-                           Root, I.isVolatile()));
+                           Root, I.isVolatile(), I.getAlignment()));
 }
 
 SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, SDOperand Ptr,
                                             const Value *SV, SDOperand Root,
-                                            bool isVolatile) {
+                                            bool isVolatile, 
+                                            unsigned Alignment) {
   SDOperand L;
   if (const VectorType *PTy = dyn_cast<VectorType>(Ty)) {
     MVT::ValueType PVT = TLI.getValueType(PTy->getElementType());
     L = DAG.getVecLoad(PTy->getNumElements(), PVT, Root, Ptr,
                        DAG.getSrcValue(SV));
   } else {
-    L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, isVolatile);
+    L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, 
+                    isVolatile, Alignment);
   }
 
   if (isVolatile)
@@ -2342,7 +2344,7 @@
   SDOperand Src = getValue(SrcV);
   SDOperand Ptr = getValue(I.getOperand(1));
   DAG.setRoot(DAG.getStore(getRoot(), Src, Ptr, I.getOperand(1), 0,
-                           I.isVolatile()));
+                           I.isVolatile(), I.getAlignment()));
 }
 
 /// IntrinsicCannotAccessMemory - Return true if the specified intrinsic cannot