[llvm] 3ffb44b - [CodeGen] Fix warnings in getVectorElementCount()

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 00:03:07 PDT 2020


Author: David Sherwood
Date: 2020-06-18T07:51:11+01:00
New Revision: 3ffb44b4481fe7bfaed67fe3e592908b9b4ad628

URL: https://github.com/llvm/llvm-project/commit/3ffb44b4481fe7bfaed67fe3e592908b9b4ad628
DIFF: https://github.com/llvm/llvm-project/commit/3ffb44b4481fe7bfaed67fe3e592908b9b4ad628.diff

LOG: [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

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/ValueTypes.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h
index 8c2ef3f9a5e1..d48a327bd238 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.


        


More information about the llvm-commits mailing list