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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 06:14:19 PDT 2023


================
@@ -101,22 +101,22 @@ bool BasicAAResult::invalidate(Function &Fn, const PreservedAnalyses &PA,
 //===----------------------------------------------------------------------===//
 
 /// Returns the size of the object specified by V or UnknownSize if unknown.
-static uint64_t getObjectSize(const Value *V, const DataLayout &DL,
-                              const TargetLibraryInfo &TLI,
-                              bool NullIsValidLoc,
+/// getObjectSize does not support scalable Value
+static TypeSize getObjectSize(const Value *V, const DataLayout &DL,
+                              const TargetLibraryInfo &TLI, bool NullIsValidLoc,
                               bool RoundToAlign = false) {
   uint64_t Size;
   ObjectSizeOpts Opts;
   Opts.RoundToAlign = RoundToAlign;
   Opts.NullIsUnknownSize = NullIsValidLoc;
   if (getObjectSize(V, Size, DL, &TLI, Opts))
-    return Size;
-  return MemoryLocation::UnknownSize;
+    return TypeSize(Size, false);
+  return TypeSize(MemoryLocation::UnknownSize, false);
----------------
nikic wrote:

Can you please rebase over https://github.com/llvm/llvm-project/commit/a3fb2348b19167dfb027e20f8e1306ebbf31cfbf and https://github.com/llvm/llvm-project/commit/d95d1c382bfc6abdf4b7764d57ba7e6098e98f5b?

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


More information about the llvm-commits mailing list