forked from OSchip/llvm-project
Constant folding support for the insertelement operation.
llvm-svn: 25407
This commit is contained in:
parent
6dce25019d
commit
e6336a9b69
|
@ -104,6 +104,9 @@ Constant *llvm::ConstantFoldInstruction(Instruction *I) {
|
|||
return 0;
|
||||
case Instruction::ExtractElement:
|
||||
return ConstantExpr::getExtractElement(Op0, Op1);
|
||||
case Instruction::InsertElement:
|
||||
if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
|
||||
return ConstantExpr::getInsertElement(Op0, Op1, Op2);
|
||||
case Instruction::GetElementPtr:
|
||||
std::vector<Constant*> IdxList;
|
||||
IdxList.reserve(I->getNumOperands()-1);
|
||||
|
|
Loading…
Reference in New Issue