[llvm] [TableGen] Add support for sparse direct-lookup tables (PR #201158)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 03:17:58 PDT 2026


jayfoad wrote:

> If the key is in range, you get a default initialized record, in the VOPD example: `(VOPDXYKey = 0, IsX = false, IsY = false)`. For an out-of-range key there is an assert in the lookup function. This is the most efficient implementation, but we probably could include extra checks to return nullptr in those cases; at the expense of more code.

I think we need to do _something_ here, otherwise the behaviour of looking up an undefined but in-range key will change depending on tablegen's heuristics of whether to generate a sparse table, which does not seem acceptable.

https://github.com/llvm/llvm-project/pull/201158


More information about the llvm-commits mailing list