mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 17:31:50 +00:00
Constant folding support for the insertelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8fcf01ead0
commit
956fd7254f
@ -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
Block a user