HomePhabricator

[TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter

Authored by foad on Mar 5 2021, 3:32 AM.

Description

[TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter

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 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 that currently "no string of bits extracted
from the encoding may exceeed 64-bits", so we can use uint64_t for some
temporaries.

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.

Differential Revision: https://reviews.llvm.org/D98046

Details

Committed
foadMar 17 2021, 2:28 AM
Differential Revision
D98046: [TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter
Parents
rGdd90c36d601e: [SLP][Test] Precommit test for D98423
Branches
Unknown
Tags
Unknown