[llvm-commits] [llvm] r58718 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
Dale Johannesen
dalej at apple.com
Tue Nov 4 12:54:04 PST 2008
Author: johannes
Date: Tue Nov 4 14:54:03 2008
New Revision: 58718
URL: http://llvm.org/viewvc/llvm-project?rev=58718&view=rev
Log:
Allow SROA of vectors. Removing this caused a
huge performance regression in something we care
about. This may not be final fix.
Modified:
llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=58718&r1=58717&r2=58718&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Nov 4 14:54:03 2008
@@ -531,8 +531,6 @@
}
}
- bool hasVector = false;
-
// Walk through the GEP type indices, checking the types that this indexes
// into.
for (; I != E; ++I) {
@@ -551,19 +549,13 @@
// integer. Specifically, consider A[0][i]. We cannot know that the user
// isn't doing invalid things like allowing i to index an out-of-range
// subscript that accesses A[1]. Because of this, we have to reject SROA
- // of any accesses into structs where any of the components are variables.
+ // of any accesses into structs where any of the components are variables.
if (IdxVal->getZExtValue() >= AT->getNumElements())
return MarkUnsafe(Info);
+ } else if (const VectorType *VT = dyn_cast<VectorType>(*I)) {
+ if (IdxVal->getZExtValue() >= VT->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)
- return MarkUnsafe(Info);
}
// If there are any non-simple uses of this getelementptr, make sure to reject
More information about the llvm-commits
mailing list