From 3ffb44b4481fe7bfaed67fe3e592908b9b4ad628 Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Tue, 16 Jun 2020 12:18:00 +0100 Subject: [PATCH] [CodeGen] Fix warnings in getVectorElementCount() In EVT::getVectorElementCount() when the type is not simple we should return getExtendedVectorElementCount() from the function instead of constructing the ElementCount object manually. I discovered this warning in an existing test: test/CodeGen/AArch64/sve-intrinsics-loads.ll Differential Revision: https://reviews.llvm.org/D81927 --- llvm/include/llvm/CodeGen/ValueTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h index 8c2ef3f..d48a327 100644 --- a/llvm/include/llvm/CodeGen/ValueTypes.h +++ b/llvm/include/llvm/CodeGen/ValueTypes.h @@ -299,7 +299,7 @@ namespace llvm { if (isSimple()) return V.getVectorElementCount(); - return {getExtendedVectorNumElements(), isExtendedScalableVector()}; + return getExtendedVectorElementCount(); } /// Given a vector type, return the minimum number of elements it contains. -- 2.7.4