[all-commits] [llvm/llvm-project] 0a0e06: [TableGen] Fix prefix detection with anchor (NFC) ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Nov 13 06:47:30 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a0e06f29145213e90de88ca39f7b505ce092a4a
      https://github.com/llvm/llvm-project/commit/0a0e06f29145213e90de88ca39f7b505ce092a4a
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M llvm/utils/TableGen/CodeGenSchedule.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list