[llvm] [TableGen] Simplify generated code for isSubclass (PR #117351)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 04:42:15 PST 2024


jayfoad wrote:

The new version uses direct lookup instead of binary search. It seems to be as fast as the nested switch version, maybe even 1% or so faster, but it is hard to tell for sure even when using `perf stat`.

The largest tables are for AArch64 and AMDGPU, both around 16 to 20 KB, but the nested switches compiled into around 30 to 40 KB of binary code so this is still a win.

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


More information about the llvm-commits mailing list