diff options
author | Chris Lattner <sabre@nondot.org> | 2004-08-13 02:43:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-08-13 02:43:19 +0000 |
commit | 889d346e6e8fad76f3f994242d4ec0efb6614cc3 (patch) | |
tree | 86f8488b7670bd9b6cd07b52e292f0af6fb0bf14 /llvm/lib/Transforms/Utils | |
parent | 2e8bfa2364a7274d38e8d28f5d461ce96a43c7b5 (diff) | |
download | bcm5719-llvm-889d346e6e8fad76f3f994242d4ec0efb6614cc3.tar.gz bcm5719-llvm-889d346e6e8fad76f3f994242d4ec0efb6614cc3.zip |
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
llvm-svn: 15712
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 72ce4ae81f3..d7507f9f07f 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -81,6 +81,11 @@ Value *llvm::MapValue(const Value *V, std::map<const Value*, Value*> &VM) { 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)); |