[PATCH] D140699: [clang] Make ValuesCode initialisation of Options constexpr

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 27 09:25:20 PST 2022


serge-sans-paille created this revision.
serge-sans-paille added reviewers: aaron.ballman, nikic.
Herald added a subscriber: hiraditya.
Herald added a project: All.
serge-sans-paille requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, MaskRay.
Herald added projects: clang, LLVM.

Current implementation requires a copy of the initialization array to a
vector to be able to modify their Values field.

This is inefficient: it requires a large copy to update a value, while
TableGen has all information to avoid this overwrite.

Modify TableGen to emit the Values code and use it to perform the
initialisation.

The impact on performance is not amazing compared to the actual
compilation, but still noticeable:

https://llvm-compile-time-tracker.com/compare.php?from=d9ab3e82f30d646deff054230b0c742704a1cf26&to=f2b37fb65d5149f70b43d1801beb5239285a2a20&stat=instructions:u


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140699

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/DriverOptions.cpp
  llvm/include/llvm/Option/OptTable.h
  llvm/lib/Option/OptTable.cpp
  llvm/utils/TableGen/OptParserEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140699.485386.patch
Type: text/x-patch
Size: 6227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221227/420f3789/attachment.bin>


More information about the cfe-commits mailing list