diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index c8ea03898e3..26f56a7ec1d 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -317,6 +317,12 @@ static Value *RemapOperand(const Value *In, Result = ConstantExpr::getInsertElement(cast(Ptr), cast(Elt), cast(Idx)); + } else if (CE->getOpcode() == Instruction::ShuffleVector) { + Value *V1 = RemapOperand(CE->getOperand(0), ValueMap); + Value *V2 = RemapOperand(CE->getOperand(1), ValueMap); + Result = ConstantExpr::getShuffleVector(cast(V1), + cast(V2), + cast(CE->getOperand(2))); } else if (CE->getNumOperands() == 1) { // Cast instruction assert(CE->getOpcode() == Instruction::Cast);