[llvm-commits] [llvm] r43271 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Bill Wendling isanbard at gmail.com
Tue Oct 23 16:36:57 PDT 2007


Author: void
Date: Tue Oct 23 18:36:57 2007
New Revision: 43271

URL: http://llvm.org/viewvc/llvm-project?rev=43271&view=rev
Log:
Fix comment and use the "Size" variable that's already provided.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=43271&r1=43270&r2=43271&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct 23 18:36:57 2007
@@ -4329,18 +4329,13 @@
           }
         }
 
-        // 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];





More information about the llvm-commits mailing list