Use type helper functions.
[oota-llvm.git] / lib / Transforms / InstCombine / InstCombineVectorOps.cpp
index 8877b99c31ba9b432492993bd0257a9e3eff1a6e..805c5d2443003827ed6241eb42c9c1a60217537b 100644 (file)
@@ -294,7 +294,7 @@ static bool CollectSingleShuffleElements(Value *V, Value *LHS, Value *RHS,
                                          SmallVectorImpl<Constant*> &Mask) {
   assert(V->getType() == LHS->getType() && V->getType() == RHS->getType() &&
          "Invalid CollectSingleShuffleElements");
-  unsigned NumElts = cast<VectorType>(V->getType())->getNumElements();
+  unsigned NumElts = V->getType()->getVectorNumElements();
 
   if (isa<UndefValue>(V)) {
     Mask.assign(NumElts, UndefValue::get(Type::getInt32Ty(V->getContext())));