[llvm] [KnownBits] Add KnownBits::makeConstantRange to determine the known bits from a pair of unsigned lo/hi bound values (PR #107080)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 05:30:35 PDT 2024


================
@@ -291,6 +291,9 @@ struct KnownBits {
     return KnownBits(~C, C);
   }
 
+  /// Create known bits from a known INCLUSIVE pair of unsigned constants.
+  static KnownBits makeConstantRange(const APInt &Lower, const APInt &Upper);
----------------
nikic wrote:

```suggestion
  static KnownBits makeInclusiveRange(const APInt &Lower, const APInt &Upper);
```
As this deviates from the usual convention, I think it's better to be more explicit about it.

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


More information about the llvm-commits mailing list