diff options
| author | Bill Wendling <isanbard@gmail.com> | 2007-10-23 23:36:57 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2007-10-23 23:36:57 +0000 |
| commit | 38ccabcae960984561044244ff5b831b229a61be (patch) | |
| tree | c702d11283139173c4dda79a965228edd0a279ae /llvm/lib/CodeGen | |
| parent | e3b859298ac22556ee785ce3a5878883389bcdf8 (diff) | |
| download | bcm5719-llvm-38ccabcae960984561044244ff5b831b229a61be.tar.gz bcm5719-llvm-38ccabcae960984561044244ff5b831b229a61be.zip | |
Fix comment and use the "Size" variable that's already provided.
llvm-svn: 43271
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 71999b44c1e..39aa07618d1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -4329,18 +4329,13 @@ void SelectionDAGLowering::visitMemIntrinsic(CallInst &I, unsigned Op) { } } - // Check to see if there is an unaligned memcpy from/onto the stack. If - // so, then ignore it for the present. + // The lowered load/store instructions from/to the stack frame can be + // unaligned depending on whether it's accessed off sp or fp. If this is + // the case, then just use the memcpy library call. if (Op1.getOpcode() == ISD::FrameIndex || - Op2.getOpcode() == ISD::FrameIndex) { - unsigned TotalSize = 0; - - for (unsigned i = 0; i < NumMemOps; i++) - TotalSize += MVT::getSizeInBits(MemOps[i]) / 8; - - if (TotalSize % Align != 0) + Op2.getOpcode() == ISD::FrameIndex) + if (Size->getValue() % Align != 0) break; - } for (unsigned i = 0; i < NumMemOps; i++) { MVT::ValueType VT = MemOps[i]; |

