[llvm-commits] CVS: llvm/lib/Transforms/Utils/ValueMapper.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 6 21:41:56 PDT 2006



Changes in directory llvm/lib/Transforms/Utils:

ValueMapper.cpp updated: 1.23 -> 1.24
---
Log message:

Fix inlining of insert/extract element constantexprs



---
Diffs of the changes:  (+9 -0)

 ValueMapper.cpp |    9 +++++++++
 1 files changed, 9 insertions(+)


Index: llvm/lib/Transforms/Utils/ValueMapper.cpp
diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.23 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.24
--- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.23	Sat Apr  1 17:17:11 2006
+++ llvm/lib/Transforms/Utils/ValueMapper.cpp	Thu Apr  6 23:41:03 2006
@@ -85,6 +85,15 @@
         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));






More information about the llvm-commits mailing list