Skip to content
Snippets Groups Projects
Commit e6336a9b authored by Robert Bocchino's avatar Robert Bocchino
Browse files

Constant folding support for the insertelement operation.

llvm-svn: 25407
parent 6dce2501
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment