[libc-commits] [libc] [libc] Refactor getL1DataCacheSize for const correctness (PR #85924)
via libc-commits
libc-commits at lists.llvm.org
Wed Mar 20 05:11:42 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 81ec95ff983afd7f31c2713891bbc37bd630a100 33a0d380da7c6a6e7cbc9e32754da3bdb17b69d7 -- libc/benchmarks/LibcMemoryBenchmark.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/benchmarks/LibcMemoryBenchmark.cpp b/libc/benchmarks/LibcMemoryBenchmark.cpp
index 71cb24b359..25dd53db83 100644
--- a/libc/benchmarks/LibcMemoryBenchmark.cpp
+++ b/libc/benchmarks/LibcMemoryBenchmark.cpp
@@ -62,18 +62,19 @@ MismatchOffsetDistribution::MismatchOffsetDistribution(size_t BufferSize,
}
static size_t getL1DataCacheSize() {
- const std::vector<CacheInfo> &CacheInfos = HostState::get().Caches;
+ const std::vector<CacheInfo> &CacheInfos = HostState::get().Caches;
- const auto IsL1DataCache = [](const CacheInfo &CI) constexpr {
- return CI.Type == "Data" && CI.Level == 1;
- };
+ const auto IsL1DataCache = [](const CacheInfo &CI) constexpr {
+ return CI.Type == "Data" && CI.Level == 1;
+ };
- const auto CacheIt = std::find_if(CacheInfos.begin(), CacheInfos.end(), IsL1DataCache);
+ const auto CacheIt =
+ std::find_if(CacheInfos.begin(), CacheInfos.end(), IsL1DataCache);
- if (CacheIt != CacheInfos.end())
- return CacheIt->Size;
+ if (CacheIt != CacheInfos.end())
+ return CacheIt->Size;
- report_fatal_error("Unable to read L1 Cache Data Size");
+ report_fatal_error("Unable to read L1 Cache Data Size");
}
static constexpr int64_t KiB = 1024;
``````````
</details>
https://github.com/llvm/llvm-project/pull/85924
More information about the libc-commits
mailing list