[llvm] [IR] Return 'unsigned' from ScalableVectorType::getMinNumElements(). (PR #98103)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 18:25:57 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>

The underlying ElementQuantity field is 'unsigned'. The similar FixedVectorType::getNumElements() returns 'unsigned'.

---
Full diff: https://github.com/llvm/llvm-project/pull/98103.diff


1 Files Affected:

- (modified) llvm/include/llvm/IR/DerivedTypes.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index 443fb7de3b821..01f76d4932780 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -631,7 +631,7 @@ class ScalableVectorType : public VectorType {
 
   /// Get the minimum number of elements in this vector. The actual number of
   /// elements in the vector is an integer multiple of this value.
-  uint64_t getMinNumElements() const { return ElementQuantity; }
+  unsigned getMinNumElements() const { return ElementQuantity; }
 
   static bool classof(const Type *T) {
     return T->getTypeID() == ScalableVectorTyID;

``````````

</details>


https://github.com/llvm/llvm-project/pull/98103


More information about the llvm-commits mailing list