[PATCH] D98046: [TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 5 07:37:23 PST 2021


foad created this revision.
foad added reviewers: dsanders, jmolloy, Joe_Nash.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch reduces the time taken for clang to compile the generated
disassembler for an out-of-tree target with InsnType bigger than 64 bits
from 4m30s to 48s.

D67686 <https://reviews.llvm.org/D67686> did a similar thing for CodeEmitterGen.

The idea is to tweak the API of the APInt-like InsnType class so that
we don't need so many temporary InsnTypes. This takes advantage of the
rule stated in D52100 <https://reviews.llvm.org/D52100> that currently "no string of bits extracted
from the encoding may exceeed 64-bits", so we can use uint64_t for some
temporaries.

D52100 <https://reviews.llvm.org/D52100> goes on to say that "fields are still permitted to exceed 64-bits
so long as they aren't one contiguous string of bits". This patch breaks
that by always using a "uint64_t tmp" in the generated decodeToMCInst,
but it should be easy to fix in FilterChooser::emitBinaryParser by
choosing to use a different type of tmp based on the known total field
width.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98046

Files:
  llvm/test/TableGen/BitOffsetDecoder.td
  llvm/test/TableGen/FixedLenDecoderEmitter/InitValue.td
  llvm/utils/TableGen/FixedLenDecoderEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98046.328527.patch
Type: text/x-patch
Size: 7471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210305/f62e491c/attachment.bin>


More information about the llvm-commits mailing list