1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[CodeGen] Fix warnings in getPackedVectorTypeFromPredicateType

Use getVectorElementCount() instead of getVectorNumElements().
The code changed in this patch is covered by an existing test:

  CodeGen/AArch64/sve-intrinsics-contiguous-prefetches.ll

Differential Revision: https://reviews.llvm.org/D80615
This commit is contained in:
David Sherwood 2020-05-26 16:33:06 +01:00
parent bb3074f462
commit 5423c8ae53

View File

@ -4625,13 +4625,13 @@ static EVT getPackedVectorTypeFromPredicateType(LLVMContext &Ctx, EVT PredVT) {
if (!PredVT.isScalableVector() || PredVT.getVectorElementType() != MVT::i1)
return EVT();
const unsigned NumElts = PredVT.getVectorNumElements();
if (NumElts != 2 && NumElts != 4 && NumElts != 8 && NumElts != 16)
if (PredVT != MVT::nxv16i1 && PredVT != MVT::nxv8i1 &&
PredVT != MVT::nxv4i1 && PredVT != MVT::nxv2i1)
return EVT();
EVT ScalarVT = EVT::getIntegerVT(Ctx, AArch64::SVEBitsPerBlock / NumElts);
EVT MemVT = EVT::getVectorVT(Ctx, ScalarVT, NumElts, /*IsScalable=*/true);
ElementCount EC = PredVT.getVectorElementCount();
EVT ScalarVT = EVT::getIntegerVT(Ctx, AArch64::SVEBitsPerBlock / EC.Min);
EVT MemVT = EVT::getVectorVT(Ctx, ScalarVT, EC);
return MemVT;
}