Fix PR11106 by correcting a typo that has been in the code for over a year. This
[oota-llvm.git] / lib / Transforms / Scalar / ScalarReplAggregates.cpp
index 3a4fac07ad3fd65a9972a6c0a26f243217e67554..c6d9123d66117477e7921c7ee768909238b815a7 100644 (file)
@@ -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);
           }