diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2022-10-20 11:58:54 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2022-10-20 11:59:19 +0000 |
commit | 35fb67a995632434b3de3e421c6d07154a0cbec1 (patch) | |
tree | dcb301dfb0d83606ceaefb8747fce11b608ce98d /libc/benchmarks | |
parent | 3a4aa24fd1b711007743c85931e50cadaa677b50 (diff) | |
download | llvm-35fb67a995632434b3de3e421c6d07154a0cbec1.tar.gz |
[libc][automemcpy] fix build after change in Arg enum
Diffstat (limited to 'libc/benchmarks')
-rw-r--r-- | libc/benchmarks/automemcpy/lib/CodeGen.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/libc/benchmarks/automemcpy/lib/CodeGen.cpp b/libc/benchmarks/automemcpy/lib/CodeGen.cpp index 2ada57a2e33b..cf196b1ad6a7 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; |