Add shufflevector support

llvm-svn: 27515
This commit is contained in:
Chris Lattner 2006-04-08 01:19:47 +00:00
parent aa3185f12e
commit 0197e454d1
1 changed files with 6 additions and 0 deletions

View File

@ -317,6 +317,12 @@ static Value *RemapOperand(const Value *In,
Result = ConstantExpr::getInsertElement(cast<Constant>(Ptr), Result = ConstantExpr::getInsertElement(cast<Constant>(Ptr),
cast<Constant>(Elt), cast<Constant>(Elt),
cast<Constant>(Idx)); cast<Constant>(Idx));
} else if (CE->getOpcode() == Instruction::ShuffleVector) {
Value *V1 = RemapOperand(CE->getOperand(0), ValueMap);
Value *V2 = RemapOperand(CE->getOperand(1), ValueMap);
Result = ConstantExpr::getShuffleVector(cast<Constant>(V1),
cast<Constant>(V2),
cast<Constant>(CE->getOperand(2)));
} else if (CE->getNumOperands() == 1) { } else if (CE->getNumOperands() == 1) {
// Cast instruction // Cast instruction
assert(CE->getOpcode() == Instruction::Cast); assert(CE->getOpcode() == Instruction::Cast);