[PATCH] D90265: [llvm][StringExtras] Add a fail-able version of `fromHex` and optimize hex digit lookup
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 10:43:34 PDT 2020
dblaikie added inline comments.
================
Comment at: llvm/include/llvm/ADT/StringExtras.h:70-101
+ static unsigned LUT[255] = {
+ /// 0-47: Non hexadecimal digits
+ -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U,
+ -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U,
+ -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U,
+ -1U, -1U, -1U,
+ /// 48-57: `0`-`9` hexadecimal digits
----------------
dexonsmith wrote:
> Can this change be separated out and committed first? It doesn't seem tightly entangled to me...
+1 for this being a separate NFC/perf-only change (would be good to have some perf measurements to support the change too)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90265/new/
https://reviews.llvm.org/D90265
More information about the llvm-commits
mailing list