[PATCH] D159527: [CodeLayout] Add unittest for cache-directed sort

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 18:43:13 PDT 2023


MaskRay marked 2 inline comments as done.
MaskRay added inline comments.


================
Comment at: llvm/unittests/Transforms/Utils/CodeLayoutTest.cpp:14
+  {
+    const std::vector<uint64_t> Sizes(3, 9);
+    const uint64_t Counts[3] = {140, 40, 140};
----------------
spupyrev wrote:
> rahmanl wrote:
> > I might be missing something. Isn't this supposed to be the same size as `Counts`?
> I agree. Does it make sense to add an assertion to catch such problems?
I think the code is correct. The https://en.cppreference.com/w/cpp/container/vector/vector (3) overload (size_type count,                 const T& value) is picked. `Sizes.size() == std::size(Counts)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159527/new/

https://reviews.llvm.org/D159527



More information about the llvm-commits mailing list