Fix the InsertAtEnd form of ShuffleVectorInst constructor to use
authorDan Gohman <gohman@apple.com>
Tue, 25 Aug 2009 23:27:45 +0000 (23:27 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 25 Aug 2009 23:27:45 +0000 (23:27 +0000)
the correct type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80050 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Instructions.cpp

index 80d5992295fa8aaf414c59f82055a9a59dde46b3..e4cf5f461aaa5a89ba2e5b2719219732f2f5c214 100644 (file)
@@ -1272,10 +1272,12 @@ ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
 ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
                                      const Twine &Name,
                                      BasicBlock *InsertAtEnd)
-  : Instruction(V1->getType(), ShuffleVector,
-                OperandTraits<ShuffleVectorInst>::op_begin(this),
-                OperandTraits<ShuffleVectorInst>::operands(this),
-                InsertAtEnd) {
+: Instruction(VectorType::get(cast<VectorType>(V1->getType())->getElementType(),
+                cast<VectorType>(Mask->getType())->getNumElements()),
+              ShuffleVector,
+              OperandTraits<ShuffleVectorInst>::op_begin(this),
+              OperandTraits<ShuffleVectorInst>::operands(this),
+              InsertAtEnd) {
   assert(isValidOperands(V1, V2, Mask) &&
          "Invalid shuffle vector instruction operands!");