From 07bb29d8ffc3b82d5a7bb1217d93e8fa86e6969a Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Fri, 30 Dec 2022 08:32:59 +0100 Subject: [OptTable] Precompute OptTable prefixes union table through tablegen This avoid rediscovering this table when reading each options, providing a sensible 2% speedup when processing and empty file, and a measurable speedup on typical workloads, see: This is optional, the legacy, on-the-fly, approach can still be used through the GenericOptTable class, while the new one is used through PrecomputedOptTable. https://llvm-compile-time-tracker.com/compare.php?from=4da6cb3202817ee2897d6b690e4af950459caea4&to=19a492b704e8f5c1dea120b9c0d3859bd78796be&stat=instructions:u Differential Revision: https://reviews.llvm.org/D140800 --- llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp') diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp index b0046e0..ade753a 100644 --- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp +++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp @@ -56,11 +56,10 @@ static constexpr opt::OptTable::Info InfoTable[] = { #undef OPTION }; -class LibOptTable : public opt::OptTable { +class LibOptTable : public opt::GenericOptTable { public: - LibOptTable() : OptTable(InfoTable, true) {} + LibOptTable() : opt::GenericOptTable(InfoTable, true) {} }; - } static std::string getDefaultOutputPath(const NewArchiveMember &FirstMember) { -- cgit v1.1