Add supprot for shufflevector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27513 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-04-08 01:19:12 +00:00
parent d5efe84646
commit 543abdf1d0
3 changed files with 35 additions and 0 deletions

View 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);