[libc-commits] [PATCH] D111622: [libc] automemcpy - codegen

Clement Courbet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Oct 13 02:56:30 PDT 2021


courbet added a comment.

As a general comment, It would be nice to see what a generated file would look like, maybe as a unit test ?



================
Comment at: libc/benchmarks/automemcpy/CodeGen.cpp:12
+// 1. Includes
+// 2. Forward declarations
+// 3. Source code for all the functions.
----------------
"Forward declarations of what ? The mem function implementations ?"


================
Comment at: libc/benchmarks/automemcpy/CodeGen.cpp:13
+// 2. Forward declarations
+// 3. Source code for all the functions.
+// 4. The function to retrieve all the function descriptors with their name.
----------------
"Source code for all the mem function implementations".


================
Comment at: libc/benchmarks/automemcpy/CodeGen.cpp:303
+  if (auto C = FD.Overlap)
+    for (size_t I = C->Span.Begin; I < C->Span.End; I *= 2)
+      Impl.Overlaps.push_back(Overlap{2 * I, ElementType{I}});
----------------
It's not a correctness issue, but it's worth nothing that not all architectures have all register sizes, e.g. x86 SSE has 1,2,4,16, but here we'll still be generating an `Overlap<8>`, which may not be very efficient...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111622



More information about the libc-commits mailing list