aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2007-10-23 23:32:40 +0000
committerBill Wendling <isanbard@gmail.com>2007-10-23 23:32:40 +0000
commit8b1c68cee4ddf42b4b57d4224f945ad9e9d4a779 (patch)
treecb695aafae8b23561b325d218bf03f1453f75c68 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent79217064c618afecd4979aec6d2e8fe784565931 (diff)
If there's an unaligned memcpy to/from the stack, don't lower it. Just call the
memcpy library function instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 610c898d17..71999b44c1 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -4329,6 +4329,19 @@ 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.
+ 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)
+ break;
+ }
+
for (unsigned i = 0; i < NumMemOps; i++) {
MVT::ValueType VT = MemOps[i];
unsigned VTSize = MVT::getSizeInBits(VT) / 8;