[llvm] [TableGen] Simplify generated code for isSubclass (PR #117351)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 26 03:17:44 PST 2024
jayfoad wrote:
> > IIUC we could have two nested switches (constant time lookup), but now we are using binary search (logarithmic time lookup). Will this cause any time related regressions?
>
> Good question. I tried measuring this with `check-llvm-mc` but the run-to-run variation was pretty high. I'll see if I can detect any difference in a single execution of `llvm-mc`.
I think I'm seeing around 1% slowdown in some cases, which is not great. Part of the difference is that isSubclass is now simple enough to be inlined, which might affect performance regardless of what algorithm is used inside isSubclass.
Here's an example I used for testing:
```sh
perf stat -e cycles -r 300 llvm-mc -triple x86_64-unknown-unknown test/MC/X86/I86-64.s -filetype=null
```
https://github.com/llvm/llvm-project/pull/117351
More information about the llvm-commits
mailing list