[llvm] [Analysis] Add Scalable field in MemoryLocation.h (PR #69716)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 07:38:09 PDT 2023


================
@@ -150,16 +159,29 @@ class LocationSize {
       return beforeOrAfterPointer();
     if (Value == AfterPointer || Other.Value == AfterPointer)
       return afterPointer();
+    if (isScalable() || Other.isScalable())
+      return afterPointer();
 
     return upperBound(std::max(getValue(), Other.getValue()));
   }
 
   bool hasValue() const {
     return Value != AfterPointer && Value != BeforeOrAfterPointer;
   }
-  uint64_t getValue() const {
+  bool isScalable() const { return (Value & ScalableBit); }
+
+  uint64_t getUIntValue() const {
     assert(hasValue() && "Getting value from an unknown LocationSize!");
-    return Value & ~ImpreciseBit;
+    assert((Value & ~(ImpreciseBit | ScalableBit)) < MaxValue &&
+           "Scalable bit of value should be masked");
+    return Value & ~(ImpreciseBit | ScalableBit);
+  }
----------------
nikic wrote:

Do we need this method? This looks the same as `getValue().getKnownMinSize()`, which makes it clearer that scalability information is being ignored.

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


More information about the llvm-commits mailing list