[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp ScalarReplAggregates.cpp

Chris Lattner sabre at nondot.org
Sat Feb 10 11:55:50 PST 2007



Changes in directory llvm/lib/Transforms/Scalar:

LoopStrengthReduce.cpp updated: 1.108 -> 1.109
ScalarReplAggregates.cpp updated: 1.70 -> 1.71
---
Log message:

Privatize StructLayout::MemberOffsets, adding an accessor


---
Diffs of the changes:  (+3 -2)

 LoopStrengthReduce.cpp   |    2 +-
 ScalarReplAggregates.cpp |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.108 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.109
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.108	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp	Sat Feb 10 13:55:17 2007
@@ -267,7 +267,7 @@
     if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
       const StructLayout *SL = TD->getStructLayout(STy);
       unsigned Idx = cast<ConstantInt>(GEP->getOperand(i))->getZExtValue();
-      uint64_t Offset = SL->MemberOffsets[Idx];
+      uint64_t Offset = SL->getElementOffset(Idx);
       GEPVal = SCEVAddExpr::get(GEPVal,
                                 SCEVUnknown::getIntegerSCEV(Offset, UIntPtrTy));
     } else {


Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.70 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.71
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.70	Fri Feb  2 08:08:20 2007
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp	Sat Feb 10 13:55:17 2007
@@ -801,7 +801,8 @@
           else
             NewOffset += AggSizeInBits-ElSizeBits*(Idx+1);
         } else if (const StructType *STy = dyn_cast<StructType>(AggTy)) {
-          unsigned EltBitOffset = TD.getStructLayout(STy)->MemberOffsets[Idx]*8;
+          unsigned EltBitOffset =
+            TD.getStructLayout(STy)->getElementOffset(Idx)*8;
           
           if (TD.isLittleEndian() || isVectorInsert)
             NewOffset += EltBitOffset;






More information about the llvm-commits mailing list