summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/ValueMapper.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-07 04:41:03 +0000
committerChris Lattner <sabre@nondot.org>2006-04-07 04:41:03 +0000
commit8ec0205de4b840c0a0ec4dbccf6dd24ce8b9fd0e (patch)
tree3a31c647fe8a6c3b14a96b9e8b85273ef32a9b87 /llvm/lib/Transforms/Utils/ValueMapper.cpp
parent5c349b8b7d9f27343768274db47b6bb6a8c6d146 (diff)
downloadbcm5719-llvm-8ec0205de4b840c0a0ec4dbccf6dd24ce8b9fd0e.tar.gz
bcm5719-llvm-8ec0205de4b840c0a0ec4dbccf6dd24ce8b9fd0e.zip
Fix inlining of insert/extract element constantexprs
llvm-svn: 27478
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index f1724db1d47..3093acafab2 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/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));
OpenPOWER on IntegriCloud