summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-10-11 21:26:40 +0000
committerCameron Zwarich <zwarich@apple.com>2011-10-11 21:26:40 +0000
commit1a761dcfbdda63e2159b5d697049aaf62c6374c5 (patch)
tree67c552b8bcf059200546336fa0c20247d7c33515 /llvm/lib
parent6dcbeaeecb4f2466768103a4efaef633736453db (diff)
downloadbcm5719-llvm-1a761dcfbdda63e2159b5d697049aaf62c6374c5.tar.gz
bcm5719-llvm-1a761dcfbdda63e2159b5d697049aaf62c6374c5.zip
Fix PR11106 by correcting a typo that has been in the code for over a year. This
would have never worked, since the element type of a vector type is never a vector type. Also fix the conditional to be more direct in checking whether EltTy is a vector type. llvm-svn: 141713
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 3a4fac07ad3..c6d9123d661 100644
--- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -2144,8 +2144,8 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
assert(StoreVal->getType() == ValTy && "Type mismatch!");
// If the requested value was a vector constant, create it.
- if (EltTy != ValTy) {
- unsigned NumElts = cast<VectorType>(ValTy)->getNumElements();
+ if (EltTy->isVectorTy()) {
+ unsigned NumElts = cast<VectorType>(EltTy)->getNumElements();
SmallVector<Constant*, 16> Elts(NumElts, StoreVal);
StoreVal = ConstantVector::get(Elts);
}
OpenPOWER on IntegriCloud