1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Fix inlining of insert/extract element constantexprs

llvm-svn: 27478
This commit is contained in:
Chris Lattner 2006-04-07 04:41:03 +00:00
parent 37b4263eb8
commit 32b65613d9

View File

@ -85,6 +85,15 @@ Value *llvm::MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
Constant *MV3 = cast<Constant>(MapValue(CE->getOperand(2), VM));
return VMSlot = ConstantExpr::getSelect(MV1, MV2, MV3);
} else if (CE->getOpcode() == Instruction::InsertElement) {
Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));
Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
Constant *MV3 = cast<Constant>(MapValue(CE->getOperand(2), VM));
return VMSlot = ConstantExpr::getInsertElement(MV1, MV2, MV3);
} else if (CE->getOpcode() == Instruction::ExtractElement) {
Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));
Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
return VMSlot = ConstantExpr::getExtractElement(MV1, MV2);
} else {
assert(CE->getNumOperands() == 2 && "Must be binary operator?");
Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));