diff options
author | Eli Friedman <efriedma@quicinc.com> | 2020-01-17 12:13:49 -0800 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2020-01-17 12:13:49 -0800 |
commit | 447dcef79001ab5b842677bbada68624aa27e583 (patch) | |
tree | 2641336436b82f188e91f92eac79b7e7fbb93e19 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 927f8f40a4c27bd47bca9a8d64786ca8b22fa38d (diff) | |
download | llvm-447dcef79001ab5b842677bbada68624aa27e583.zip llvm-447dcef79001ab5b842677bbada68624aa27e583.tar.gz llvm-447dcef79001ab5b842677bbada68624aa27e583.tar.bz2 |
Revert "[SVE] Pass Scalable argument to VectorType::get in Bitcode Reader"
This reverts commit 5df53a22592729e631c4030f38c599b9f37095b7.
Caused test failures.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 1a5bd02..1eefb1b 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -2630,13 +2630,12 @@ Error BitcodeReader::parseConstants() { Type *SelectorTy = Type::getInt1Ty(Context); - // The selector might be an i1, an <n x i1>, or a <vscale x n x i1> + // The selector might be an i1 or an <n x i1> // Get the type from the ValueList before getting a forward ref. if (VectorType *VTy = dyn_cast<VectorType>(CurTy)) if (Value *V = ValueList[Record[0]]) if (SelectorTy != V->getType()) - SelectorTy = VectorType::get(SelectorTy, - VTy->getElementCount()); + SelectorTy = VectorType::get(SelectorTy, VTy->getNumElements()); V = ConstantExpr::getSelect(ValueList.getConstantFwdRef(Record[0], SelectorTy), @@ -2694,7 +2693,7 @@ Error BitcodeReader::parseConstants() { Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy); Constant *Op1 = ValueList.getConstantFwdRef(Record[1], OpTy); Type *ShufTy = VectorType::get(Type::getInt32Ty(Context), - OpTy->getElementCount()); + OpTy->getNumElements()); Constant *Op2 = ValueList.getConstantFwdRef(Record[2], ShufTy); V = ConstantExpr::getShuffleVector(Op0, Op1, Op2); break; @@ -2708,7 +2707,7 @@ Error BitcodeReader::parseConstants() { Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy); Constant *Op1 = ValueList.getConstantFwdRef(Record[2], OpTy); Type *ShufTy = VectorType::get(Type::getInt32Ty(Context), - RTy->getElementCount()); + RTy->getNumElements()); Constant *Op2 = ValueList.getConstantFwdRef(Record[3], ShufTy); V = ConstantExpr::getShuffleVector(Op0, Op1, Op2); break; @@ -4169,15 +4168,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) { return error("Invalid record"); if (!Vec1->getType()->isVectorTy() || !Vec2->getType()->isVectorTy()) return error("Invalid type for value"); - - ElementCount EC1 = cast<VectorType>(Vec1->getType())->getElementCount(); - - if (EC1 != cast<VectorType>(Vec2->getType())->getElementCount()) - return error("Mismatch between argument types"); - I = new ShuffleVectorInst(Vec1, Vec2, Mask); FullTy = VectorType::get(FullTy->getVectorElementType(), - EC1); + Mask->getType()->getVectorNumElements()); InstructionList.push_back(I); break; } |