diff options
author | Mon P Wang <wangmp@apple.com> | 2008-11-10 04:46:22 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-11-10 04:46:22 +0000 |
commit | aeb06d246254e4829a49164a11eacced9a43d9d4 (patch) | |
tree | 4b957844db686ae68329005faa6762317429037f /lib/VMCore/Verifier.cpp | |
parent | a64f463fb90c66406033e3fd1dc912b648bad328 (diff) | |
download | external_llvm-aeb06d246254e4829a49164a11eacced9a43d9d4.zip external_llvm-aeb06d246254e4829a49164a11eacced9a43d9d4.tar.gz external_llvm-aeb06d246254e4829a49164a11eacced9a43d9d4.tar.bz2 |
Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index f8dd24c..027aea7 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1098,14 +1098,15 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) { Assert1(ShuffleVectorInst::isValidOperands(SV.getOperand(0), SV.getOperand(1), SV.getOperand(2)), "Invalid shufflevector operands!", &SV); - Assert1(SV.getType() == SV.getOperand(0)->getType(), - "Result of shufflevector must match first operand type!", &SV); - + + const VectorType *VTy = dyn_cast<VectorType>(SV.getOperand(0)->getType()); + Assert1(VTy, "Operands are not a vector type", &SV); + // Check to see if Mask is valid. if (const ConstantVector *MV = dyn_cast<ConstantVector>(SV.getOperand(2))) { for (unsigned i = 0, e = MV->getNumOperands(); i != e; ++i) { if (ConstantInt* CI = dyn_cast<ConstantInt>(MV->getOperand(i))) { - Assert1(!CI->uge(MV->getNumOperands()*2), + Assert1(!CI->uge(VTy->getNumElements()*2), "Invalid shufflevector shuffle mask!", &SV); } else { Assert1(isa<UndefValue>(MV->getOperand(i)), @@ -1117,7 +1118,7 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) { isa<ConstantAggregateZero>(SV.getOperand(2)), "Invalid shufflevector shuffle mask!", &SV); } - + visitInstruction(SV); } |