[libc-commits] [libc] [libc][benchmark] allow benchmark to be built without llvm support (PR #200951)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Tue Jun 2 07:42:36 PDT 2026


================
@@ -70,14 +74,19 @@ static size_t getL1DataCacheSize() {
   if (CacheIt != CacheInfos.end())
     return CacheIt->Size;
   report_fatal_error("Unable to read L1 Cache Data Size");
+#else
+  return std::nullopt;
+#endif
 }
 
 static constexpr int64_t KiB = 1024;
 static constexpr int64_t ParameterStorageBytes = 4 * KiB;
 static constexpr int64_t L1LeftAsideBytes = 1 * KiB;
 
 static size_t getAvailableBufferSize() {
-  return getL1DataCacheSize() - L1LeftAsideBytes - ParameterStorageBytes;
+  auto L1Size = getL1DataCacheSize();
+  return (L1Size ? *L1Size : 32 * 1024) - L1LeftAsideBytes -
----------------
kaladron wrote:

Is the 32 in the fallback case real and usable?  Or will people think they're getting information that they're not?

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


More information about the libc-commits mailing list