This patch enables jump table lowering in the RISC-V backend.
In addition to the test case included, the new lowering was
tested by compiling the OCaml runtime and running it under qemu.
nand on Nov 25 2020, 6:01 AM.Authored by
Is there anything I could do to test the impact on code size? As I mentioned previously, in my setting I cannot easily turn the use of jump tables off. Are there any binaries that are relatively easy to cross compile and are of interest?
Cool. I think we can tweak the threshold later, but this should start us in a reasonable place. Thanks for your patience, I'm happy for this to land.
The previous discussion pointed out that GCC's default threshold on RISC-V was 5 (thanks @kito-cheng for the link). We match that here, so that should avoid the worst of the performance regressions.
I agree with @lenary, I think this is fine to land (with the whitespace fix :)) and if it turns out the threshold is too low then we'll soon find out and can adjust accordingly (but I imagine not, 5 feels like a sensible default). Or if it's too high!