[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


================
@@ -175,15 +178,17 @@ static uint64_t getMinimalExtentFrom(const Value &V,
   // If queried with a precise location size, we assume that location size to be
   // accessed, thus valid.
   if (LocSize.isPrecise())
-    DerefBytes = std::max(DerefBytes, LocSize.getValue());
-  return DerefBytes;
+    DerefBytes = std::max(DerefBytes, LocSize.getValue().getKnownMinValue());
+  // FIXME: Is this right?
----------------
nikic wrote:

I don't think it is. You might combine the result from getPointerDereferenceableBytes with the scalable from from LocSize. I think you should just drop the scalable flag from the result here (this is conservatively correct).

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


More information about the llvm-commits mailing list