diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-07 04:41:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-07 04:41:03 +0000 |
commit | 8960766d459ef618f5415dab4b19fca67611b054 (patch) | |
tree | ff2833e4280c533156d096849961b32562edd330 /lib/Transforms | |
parent | 39c61fd5274509f34766073f10aaa20c99068804 (diff) | |
download | external_llvm-8960766d459ef618f5415dab4b19fca67611b054.zip external_llvm-8960766d459ef618f5415dab4b19fca67611b054.tar.gz external_llvm-8960766d459ef618f5415dab4b19fca67611b054.tar.bz2 |
Fix inlining of insert/extract element constantexprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Utils/ValueMapper.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp index f1724db..3093aca 100644 --- a/lib/Transforms/Utils/ValueMapper.cpp +++ b/lib/Transforms/Utils/ValueMapper.cpp @@ -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)); |