Add shufflevector support
authorChris Lattner <sabre@nondot.org>
Sat, 8 Apr 2006 01:19:47 +0000 (01:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Apr 2006 01:19:47 +0000 (01:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27515 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp

index c8ea03898e348a0568b93d9811377a57f3e0a4de..26f56a7ec1d6798cd951d2a474606b9e5b65609d 100644 (file)
@@ -317,6 +317,12 @@ static Value *RemapOperand(const Value *In,
         Result = ConstantExpr::getInsertElement(cast<Constant>(Ptr),
                                                 cast<Constant>(Elt),
                                                 cast<Constant>(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<Constant>(V1),
+                                                cast<Constant>(V2),
+                                             cast<Constant>(CE->getOperand(2)));
       } else if (CE->getNumOperands() == 1) {
         // Cast instruction
         assert(CE->getOpcode() == Instruction::Cast);