[llvm-dev] Global ISel match table

Paul C. Anagnostopoulos via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 16 06:50:07 PST 2020


Indeed, this is certainly a complication. If we go to uint32_t, then we could use table indexes for those commands, correct? Surely no table will ever have more than 4 billion entries.

In anticipation of working on this, can you tell me what is the easiest way to test such changes? I haven't gotten my head around the testing procedures yet.


At 12/15/2020 10:44 PM, Daniel Sanders wrote:
>Most of the reasons boil down to not having the time needed to implement something better. There is one bit I'm aware of that snowballs a bit when using uint32_t or smaller. Labels and JumpTargets are currently absolute which allows them to be recorded in a simple lookup table during the first pass to encode on the second. JumpTargets will need to become relative (and know where they are in the table) to cope with a large ruleset and reduced range but that also means you have to start measuring distances between two points in the table. For fixed-sized commands that's not too bad but if the range drops below the minimum then you also have to go to variable length commands (or waste space on padding). That in turn means that you need to determine the encoded size of commands on the first pass (including JumpTargets which have unknown encoding until the label is seen later) so that the labels know their position for the second pass when we encode the table. We'll have to go from the two-pass approach to a relaxation one.



More information about the llvm-dev mailing list