[libc-commits] [libc] 35fb67a - [libc][automemcpy] fix build after change in Arg enum

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Thu Oct 20 04:59:39 PDT 2022


Author: Guillaume Chatelet
Date: 2022-10-20T11:59:19Z
New Revision: 35fb67a995632434b3de3e421c6d07154a0cbec1

URL: https://github.com/llvm/llvm-project/commit/35fb67a995632434b3de3e421c6d07154a0cbec1
DIFF: https://github.com/llvm/llvm-project/commit/35fb67a995632434b3de3e421c6d07154a0cbec1.diff

LOG: [libc][automemcpy] fix build after change in Arg enum

Added: 
    

Modified: 
    libc/benchmarks/automemcpy/lib/CodeGen.cpp

Removed: 
    


################################################################################
diff  --git a/libc/benchmarks/automemcpy/lib/CodeGen.cpp b/libc/benchmarks/automemcpy/lib/CodeGen.cpp
index 2ada57a2e33b0..cf196b1ad6a7b 100644
--- a/libc/benchmarks/automemcpy/lib/CodeGen.cpp
+++ b/libc/benchmarks/automemcpy/lib/CodeGen.cpp
@@ -117,8 +117,6 @@ struct Context {
   StringRef ElementOp; // copy, three_way_compare, splat_set, ...
   StringRef FixedSizeArgs;
   StringRef RuntimeSizeArgs;
-  StringRef AlignArg1;
-  StringRef AlignArg2;
   StringRef DefaultReturnValue;
 };
 // A detailed representation of the function implementation mapped from the
@@ -143,8 +141,6 @@ static Context getCtx(FunctionType FT) {
             "copy",
             "(dst, src)",
             "(dst, src, size)",
-            "Arg::Dst",
-            "Arg::Src",
             ""};
   case FunctionType::MEMCMP:
     return {"int",
@@ -152,8 +148,6 @@ static Context getCtx(FunctionType FT) {
             "three_way_compare",
             "(lhs, rhs)",
             "(lhs, rhs, size)",
-            "Arg::Lhs",
-            "Arg::Rhs",
             "0"};
   case FunctionType::MEMSET:
     return {"void",
@@ -161,25 +155,22 @@ static Context getCtx(FunctionType FT) {
             "splat_set",
             "(dst, value)",
             "(dst, value, size)",
-            "Arg::Dst",
-            "Arg::Src",
             ""};
   case FunctionType::BZERO:
     return {"void",           "(char * dst, size_t size)",
             "splat_set",      "(dst, 0)",
-            "(dst, 0, size)", "Arg::Dst",
-            "Arg::Src",       ""};
+            "(dst, 0, size)", ""};
   default:
     report_fatal_error("Not yet implemented");
   }
 }
 
-static StringRef getAligntoString(const Context &Ctx, const AlignArg &AlignTo) {
+static StringRef getAligntoString(const AlignArg &AlignTo) {
   switch (AlignTo) {
   case AlignArg::_1:
-    return Ctx.AlignArg1;
+    return "Arg::P1";
   case AlignArg::_2:
-    return Ctx.AlignArg2;
+    return "Arg::P2";
   case AlignArg::ARRAY_SIZE:
     report_fatal_error("logic error");
   }
@@ -295,9 +286,9 @@ getImplementation(const NamedFunctionDescriptor &NamedFD) {
   if (const auto &L = FD.Loop)
     Impl.Loop = Loop{L->Span.End, ElementType{L->BlockSize}};
   if (const auto &AL = FD.AlignedLoop)
-    Impl.AlignedLoop = AlignedLoop{
-        AL->Loop.Span.End, ElementType{AL->Loop.BlockSize},
-        ElementType{AL->Alignment}, getAligntoString(Impl.Ctx, AL->AlignTo)};
+    Impl.AlignedLoop =
+        AlignedLoop{AL->Loop.Span.End, ElementType{AL->Loop.BlockSize},
+                    ElementType{AL->Alignment}, getAligntoString(AL->AlignTo)};
   if (const auto &A = FD.Accelerator)
     Impl.Accelerator = Accelerator{A->Span.End};
   return Impl;


        


More information about the libc-commits mailing list