Allow SROA of vectors. Removing this caused a

huge performance regression in something we care
about.  This may not be final fix.

llvm-svn: 58718
This commit is contained in:
Dale Johannesen 2008-11-04 20:54:03 +00:00
parent db6b956585
commit 0a7b4f5800
1 changed files with 4 additions and 12 deletions

View File

@ -531,8 +531,6 @@ void SROA::isSafeUseOfAllocation(Instruction *User, AllocationInst *AI,
}
}
bool hasVector = false;
// Walk through the GEP type indices, checking the types that this indexes
// into.
for (; I != E; ++I) {
@ -554,17 +552,11 @@ void SROA::isSafeUseOfAllocation(Instruction *User, AllocationInst *AI,
// of any accesses into structs where any of the components are variables.
if (IdxVal->getZExtValue() >= AT->getNumElements())
return MarkUnsafe(Info);
}
// Note if we've seen a vector type yet
hasVector |= isa<VectorType>(*I);
// Don't SROA pointers into vectors, unless all indices are zero. When all
// indices are zero, we only consider this GEP as a bitcast, but will still
// not consider breaking up the vector.
if (hasVector && !IsAllZeroIndices)
} else if (const VectorType *VT = dyn_cast<VectorType>(*I)) {
if (IdxVal->getZExtValue() >= VT->getNumElements())
return MarkUnsafe(Info);
}
}
// If there are any non-simple uses of this getelementptr, make sure to reject
// them.