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

Chris Lattner lattner at cs.uiuc.edu
Thu Aug 12 19:43:31 PDT 2004



Changes in directory llvm/lib/Transforms/Utils:

ValueMapper.cpp updated: 1.17 -> 1.18
---
Log message:

Add value mapper support for select constant exprs.  This should fix a bug
Nate ran into when bugpointing siod.  This fix should go into LLVM 1.3


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

Index: llvm/lib/Transforms/Utils/ValueMapper.cpp
diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.17 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.18
--- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.17	Wed Aug  4 03:22:15 2004
+++ llvm/lib/Transforms/Utils/ValueMapper.cpp	Thu Aug 12 21:43:19 2004
@@ -81,6 +81,11 @@
         for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
           Idx.push_back(cast<Constant>(MapValue(CE->getOperand(i), VM)));
         return VMSlot = ConstantExpr::getGetElementPtr(MV, Idx);
+      } else if (CE->getOpcode() == Instruction::Select) {
+        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::getSelect(MV1, MV2, MV3);
       } 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