Files
clang-p2996/llvm/utils/TableGen/CodeGenSchedule.cpp
Nikita Popov 0a0e06f291 [TableGen] Fix prefix detection with anchor (NFC) (#71379)
instregex uses an optimization, where the constant prefix of the regex
is extracted to perform a binary search first. However, this
optimization currently mainly fails to apply, because most instregex
uses have an explicit ^ anchor, which gets counted as a meta char and
disables the optimization.

Make sure the anchor is skipped when determining the prefix. Also fix an
implementation bug this exposes, where the pick a too long prefix if the
first meta character is a quantifier.

This cuts the time needed to generate files like X86GenInstrInfo.inc by
half.
2023-11-13 15:47:15 +01:00

87 KiB