diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-05 20:43:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-05 20:43:58 +0000 |
commit | 8055fb3afac2e9f4209787cc919289414bae24e9 (patch) | |
tree | d606fd60325b36a543c9885e229af9d30977ab61 /llvm/lib | |
parent | ba55bd37fea1fb58f846b5cc78fff0ed4d95521c (diff) | |
download | bcm5719-llvm-8055fb3afac2e9f4209787cc919289414bae24e9.tar.gz bcm5719-llvm-8055fb3afac2e9f4209787cc919289414bae24e9.zip |
Yet more fixes for constant expr shifts
llvm-svn: 9739
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index adf2c5548e8..6590498bbc1 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -82,6 +82,12 @@ Value *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::Shl || + CE->getOpcode() == Instruction::Shr) { + assert(CE->getNumOperands() == 2 && "Must be a shift!"); + Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM)); + Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM)); + return VMSlot = ConstantExpr::getShift(CE->getOpcode(), MV1, MV2); } else { assert(CE->getNumOperands() == 2 && "Must be binary operator?"); Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM)); |