[llvm] [MemoryBuiltins] Add getBaseObjectSize() (NFCI) (PR #155911)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 29 12:52:09 PDT 2025


================
@@ -589,6 +589,59 @@ bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL,
   return true;
 }
 
+std::optional<TypeSize> llvm::getBaseObjectSize(const Value *Ptr,
+                                                const DataLayout &DL,
+                                                const TargetLibraryInfo *TLI,
+                                                ObjectSizeOpts Opts) {
+  assert(Opts.EvalMode == ObjectSizeOpts::Mode::ExactSizeFromOffset &&
----------------
nikic wrote:

> I assume barley any positive impact on compiletime, not barley any difference to the current version of the patch, right?

Right. The results look like this: https://llvm-compile-time-tracker.com/compare.php?from=f65f60ee2359e47480c897d4174bc7471d151832&to=71a6fe61c60652ac76fdc5ae4b882cce51909324&stat=instructions:u

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


More information about the llvm-commits mailing list