Add supprot for shufflevector
[oota-llvm.git] / lib / Transforms / Utils / Local.cpp
index a35a1a69af1ae096251bd9d778197dfb58aa9431..a848e7461eb3f87f55578fe2ddfa16c2ab73f08f 100644 (file)
@@ -107,6 +107,11 @@ Constant *llvm::ConstantFoldInstruction(Instruction *I) {
   case Instruction::InsertElement:
     if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
       return ConstantExpr::getInsertElement(Op0, Op1, Op2);
+    return 0;
+  case Instruction::ShuffleVector:
+    if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
+      return ConstantExpr::getShuffleVector(Op0, Op1, Op2);
+    return 0;
   case Instruction::GetElementPtr:
     std::vector<Constant*> IdxList;
     IdxList.reserve(I->getNumOperands()-1);