[llvm-commits] [llvm] r42508 - in /llvm/trunk/lib: CodeGen/AsmPrinter.cpp CodeGen/SelectionDAG/SelectionDAGISel.cpp Transforms/Scalar/LoopStrengthReduce.cpp

Dale Johannesen dalej at apple.com
Mon Oct 1 16:08:35 PDT 2007


Author: johannes
Date: Mon Oct  1 18:08:35 2007
New Revision: 42508

URL: http://llvm.org/viewvc/llvm-project?rev=42508&view=rev
Log:
Fix stride computations for long double arrays.


Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=42508&r1=42507&r2=42508&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Mon Oct  1 18:08:35 2007
@@ -816,8 +816,12 @@
     if (CVA->isString()) {
       EmitString(CVA);
     } else { // Not a string.  Print the values in successive locations
-      for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
+      for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) {
         EmitGlobalConstant(CVA->getOperand(i));
+        const Type* EltTy = CVA->getType()->getElementType();
+        uint64_t padSize = TD->getABITypeSize(EltTy) - TD->getTypeSize(EltTy);
+        EmitZeros(padSize);
+      }
     }
     return;
   } else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Oct  1 18:08:35 2007
@@ -2279,13 +2279,13 @@
       if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
         if (CI->getZExtValue() == 0) continue;
         uint64_t Offs = 
-            TD->getTypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
+            TD->getABITypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
         N = DAG.getNode(ISD::ADD, N.getValueType(), N, getIntPtrConstant(Offs));
         continue;
       }
       
       // N = N + Idx * ElementSize;
-      uint64_t ElementSize = TD->getTypeSize(Ty);
+      uint64_t ElementSize = TD->getABITypeSize(Ty);
       SDOperand IdxN = getValue(Idx);
 
       // If the index is smaller or larger than intptr_t, truncate or extend

Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=42508&r1=42507&r2=42508&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Oct  1 18:08:35 2007
@@ -286,7 +286,7 @@
       Value *OpVal = getCastedVersionOf(opcode, GEP->getOperand(i));
       SCEVHandle Idx = SE->getSCEV(OpVal);
 
-      uint64_t TypeSize = TD->getTypeSize(GTI.getIndexedType());
+      uint64_t TypeSize = TD->getABITypeSize(GTI.getIndexedType());
       if (TypeSize != 1)
         Idx = SCEVMulExpr::get(Idx,
                                SCEVConstant::get(ConstantInt::get(UIntPtrTy,





More information about the llvm-commits mailing list