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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 07:11:15 PDT 2023


================
@@ -176,14 +176,14 @@ 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());
+  return LocationSize(DerefBytes);
----------------
nikic wrote:

Yes, what I had in mind is to just use `TypeSize::getFixed(DerefBytes)` instead of `LocationSize(DerefBytes)`, nothing more. More precisely handling scalable vectors can be a followup.

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


More information about the llvm-commits mailing list