[PATCH] D90320: [llvm][StringExtras] Use a lookup table for `hexDigitValue`

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 11:54:09 PDT 2020


rriddle marked 2 inline comments as done.
rriddle added a comment.

In D90320#2359587 <https://reviews.llvm.org/D90320#2359587>, @dblaikie wrote:

> If you like you could try rephrasing this as a programmatic initialization rather than writing it all out manually, might make it easier to read/look more like the original code (except applied as a loop over the range/table) and hopefully can be phrased in such a way that the compiler boils it down to the same values anyway.

Thanks for the suggestion! That would definitely be much nicer. I tried about 4-5 different ways of doing the initialization and I could only get clang to generate a proper LUT in C++17(using constexpr lambda initialization with std::array), not C++14. I couldn't get GCC to do the right thing in either C++14 or C++17. Do you have any suggestions on how to do the initialization?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90320



More information about the llvm-commits mailing list