[llvm-commits] [poolalloc] r122028 - /poolalloc/trunk/lib/DSA/Local.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Thu Dec 16 18:36:02 PST 2010
Author: aggarwa4
Date: Thu Dec 16 20:36:02 2010
New Revision: 122028
URL: http://llvm.org/viewvc/llvm-project?rev=122028&view=rev
Log:
Remove dead code. Also, revert the change that allows
merging arrays of multiple sizes.
Modified:
poolalloc/trunk/lib/DSA/Local.cpp
Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=122028&r1=122027&r2=122028&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Thu Dec 16 20:36:02 2010
@@ -568,10 +568,6 @@
if(!Value.getNode()->isArrayNode() || Value.getNode()->getSize() <= 0){
if (requiredSize > Value.getNode()->getSize())
Value.getNode()->growSize(requiredSize);
- } else {
- if (((Offset + Value.getOffset()) % Value.getNode()->getSize()) == 0
- && (TD.getTypeAllocSize(STy) % Value.getNode()->getSize() == 0))
- Value.getNode()->growSize(requiredSize);
}
Offset += (unsigned)TD.getStructLayout(STy)->getElementOffset(FieldNo);
@@ -642,36 +638,6 @@
}
-#if 0
- if (const SequentialType *STy = cast<SequentialType>(*I)) {
- CurTy = STy->getElementType();
- if (ConstantInt *CS = dyn_cast<ConstantInt>(GEP.getOperand(i))) {
- Offset +=
- (CS->getType()->isSigned() ? CS->getSExtValue() : CS->getZExtValue())
- * TD.getTypeAllocSize(CurTy);
- } else {
- // Variable index into a node. We must merge all of the elements of the
- // sequential type here.
- if (isa<PointerType>(STy)) {
- DEBUG(errs() << "Pointer indexing not handled yet!\n");
- } else {
- const ArrayType *ATy = cast<ArrayType>(STy);
- unsigned ElSize = TD.getTypeAllocSize(CurTy);
- DSNode *N = Value.getNode();
- assert(N && "Value must have a node!");
- unsigned RawOffset = Offset+Value.getOffset();
-
- // Loop over all of the elements of the array, merging them into the
- // zeroth element.
- for (unsigned i = 1, e = ATy->getNumElements(); i != e; ++i)
- // Merge all of the byte components of this array element
- for (unsigned j = 0; j != ElSize; ++j)
- N->mergeIndexes(RawOffset+j, RawOffset+i*ElSize+j);
- }
- }
- }
-#endif
-
// Add in the offset calculated...
Value.setOffset(Value.getOffset()+Offset);
More information about the llvm-commits
mailing list