[llvm] Add the 'initialized' attribute langref and support (PR #84803)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 12:55:11 PDT 2024


================
@@ -226,6 +236,10 @@ class Attribute {
   /// attribute to be a ConstantRange attribute.
   ConstantRange getValueAsConstantRange() const;
 
+  /// Return the attribute's value as a const range list. This requires the
+  /// attribute to be a const range list attribute.
+  SmallVector<std::pair<int64_t, int64_t>, 16> getValueAsRanges() const;
----------------
aeubanks wrote:

also, 16 elements for the small vector optimization seems very high, I feel the vast majority of cases will be at most 4. I'd choose 4 (or even 2)

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


More information about the llvm-commits mailing list