mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Fix inlining of insert/extract element constantexprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27478 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
39c61fd527
commit
8960766d45
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user