[llvm-commits] [LLVMdev] TableGen backend support to express relations between instruction

Jyotsna Verma jverma at codeaurora.org
Sat Sep 1 22:39:37 PDT 2012


> The tables you are emitting are very large and very sparse. You should
only emit the rows that have a key instruction, and use a binary search
instead of using the opcode as an index directly. That will save a lot of
memory, particular for small tables like the ones Hal needs.

You are right about the tables being large and sparse. However, we convert
between  instruction formats a lot during packetization and binary search
may increase compile time significantly. I'm trying to come up with some
alternate approach that would reduce memory usage yet provide faster access
to the new format. I'm thinking of something like this:

Have 2 tables - 1st table will be indexed using the instruction Opcode and
will provide index into the relationship table (one cumulative table for all
relations).
As you mentioned, this table will have entries only for the instructions
with any relations. Since, each instruction will have only a few of all
possible relations, I'm planning to keep a bit map with each instruction
which will list all the valid relations and their position. This way I can
make relationship table totally dense but still can access new format with
O(1).

-Jyotsna







More information about the llvm-commits mailing list