diff options
author | Christopher Lamb <christopher.lamb@gmail.com> | 2007-04-21 08:16:25 +0000 |
---|---|---|
committer | Christopher Lamb <christopher.lamb@gmail.com> | 2007-04-21 08:16:25 +0000 |
commit | bff50208c8622fbcf8c8fdaac61ff81670de1423 (patch) | |
tree | ab39674971382d5bb5d26ac2f3eef372113d986d /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 64995e1b3f9311c8a44af06e4bd1d8d49c4dc862 (diff) | |
download | bcm5719-llvm-bff50208c8622fbcf8c8fdaac61ff81670de1423.tar.gz bcm5719-llvm-bff50208c8622fbcf8c8fdaac61ff81670de1423.zip |
add support for alignment attributes on load/store instructions
llvm-svn: 36301
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e009488fd61..f2833c736aa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -498,7 +498,7 @@ public: 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 @@ void SelectionDAGLowering::visitLoad(LoadInst &I) { } 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 @@ void SelectionDAGLowering::visitStore(StoreInst &I) { 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 |