diff options
author | Dan Gohman <gohman@apple.com> | 2011-07-21 23:30:09 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2011-07-21 23:30:09 +0000 |
commit | 856e13ddace4174ad1b07f65ebb18b2fd835ed57 (patch) | |
tree | 3055818eb6850f9fc842d47897e12080a1ed12a9 /lib/Transforms/Scalar/ScalarReplAggregates.cpp | |
parent | 7c6e42e9273168ba9b1273a1580d569e1bac0e91 (diff) |
Fix MergeInVectorType to check for vector types with the same alloc
size but different element types, so that it filters out the cases
that CreateShuffleVectorCast doesn't handle. This fixes rdar://9786827.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r-- | lib/Transforms/Scalar/ScalarReplAggregates.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index fbf309292d..b3d7ef6ec1 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -425,6 +425,12 @@ bool ConvertToScalarInfo::MergeInVectorType(VectorType *VInTy, Type *ElementTy = VectorTy->getElementType(); Type *InElementTy = VInTy->getElementType(); + // If they're the same alloc size, we'll be attempting to convert between + // them with a vector shuffle, which requires the element types to match. + if (TD.getTypeAllocSize(VectorTy) == TD.getTypeAllocSize(VInTy) && + ElementTy != InElementTy) + return false; + // Do not allow mixed integer and floating-point accesses from vectors of // different sizes. if (ElementTy->isFloatingPointTy() != InElementTy->isFloatingPointTy()) |