handle ConstantVector while I'm in here.
authorChris Lattner <sabre@nondot.org>
Thu, 7 Jan 2010 01:20:20 +0000 (01:20 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Jan 2010 01:20:20 +0000 (01:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92892 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/GlobalOpt.cpp

index 294904212e3048c1e373bfd472ca5013a0ab878f..ee260e9488e98b31f92c330f837a62ec74bb7141 100644 (file)
@@ -2133,6 +2133,9 @@ static Constant *EvaluateStoreInto(Constant *Init, Constant *Val,
     if (ConstantArray *CA = dyn_cast<ConstantArray>(Init)) {
       for (User::op_iterator i = CA->op_begin(), e = CA->op_end(); i != e; ++i)
         Elts.push_back(cast<Constant>(*i));
+    } else if (ConstantVector *CV = dyn_cast<ConstantVector>(Init)) {
+      for (User::op_iterator i = CV->op_begin(), e = CV->op_end(); i != e; ++i)
+        Elts.push_back(cast<Constant>(*i));
     } else if (isa<ConstantAggregateZero>(Init)) {
       Elts.assign(NumElts, Constant::getNullValue(InitTy->getElementType()));
     } else {